My teacher has told me to put reverse = True
to make it sort highest to lowest but I really don't know where. My code is shown below.
import csv
f = open ('sort.txt')
csv_f = csv.reader(f)
newlist = []
for row in csv_f:
row[1] = int(row[1])
row[2] = int(row[2])
row[3] = int(row[3])
sort = sorted(row[1:4])
row.append(sort)
newlist.append(row[0:8])
print(newlist)
Can anyone please tell me where I would put reverse = True
to make it print the scores highest to lowest?