I have a big txt file, with datas like this format:
Name Points
Joe 1
Joe 5
Anna 6
Anna 1
Eva 9
Eva 6
(There is more line and name, but the same number of lines per name.)
And I need the sum of the numbers by names in a list, and the main goal is to find the first ten name with the greatest sum.
Something like that:
Best:
Eva 15
Anna 7
Joe 6
How would you solve it?
(I tryed and now I got stuck: I can open the file, spilt it into lines, and split it to words like this:
file = open('sum.txt')
with open('sum.txt') as f:
line = f.readlines()
line[1].split()
But all other kind of solutions are welcome.)