I currently have some data stored in a file that has a persons name and the score that they got when they played the game.
The data in the file looks like this:
Reece 0
John 5
Alex 2
I have tried using something like this:
with open("Scores.txt","r") as f:
lines = sorted(f.readlines())
print lines
But that just sorts them by the first letter in each of their names.
My output would need to be like this:
Reece 0
Alex 2
John 5
It is a relatively simple program and I am using Python 2.7
Any help would be amazing I can also provide any info on my program!