I have some trouble making a code that arranges a .txt file in numerical order.
The problem I'm having is when ordering numbers 77, 45, 85, 100 in the .txt file it orders it as 100, 45, 77, 85; 100 being the lowest.
Not sure how I would correct that as I want 100 to be the highest.
This is what I have so far:
import csv
import operator
sample = open("score.txt")
csv1 = csv.reader(sample, delimiter=',')
sort = sorted(csv1, key=operator.itemgetter(1))
for eachline in sort:
print eachline