Rewriting my scores text file to make sure it only has the Last 4 scores (python)
问题 Previously, I had - with the help of SO users - been able to find how to store a maximum of 4 keys inside a Python Document with the maxlength property inside the dictionary. Now, I want to go further. Below is a text file with all the recent scores of my participants - Dave, Jack and Adam. Jack:10 Dave:20 Adam:30 Jack:40 Adam:50 Dave:60 Jack:70 Dave:80 Jack:90 Jack:100 Dave:110 Dave:120 Adam:130 Adam:140 Adam:150 Now, here is my code that lets me see the last 4 Scores in Python: import