this is my code that imports the file, adds it to a list and sorts the list from highest to lowest:
for x in range (1):
scoresList = [ ] #this is a variable for the list
file = open("Leaderboard file.txt", "r") #this opens the file as a read file
file_line = file.readlines() #this then reads the lines
scoresList.append(file_line) #this then appends the lines to the list
file.close()
leaderboard_list = sorted(scoresList, reverse=True) #this is supposed to order the numbers yet it doesnt seem to do anything
print(leaderboard_list)
start_menu()
this is what it prints out:
[['\n', "35['jerry'] 20['bill']15['Dan']20['billy']"]]
and this is the file it is getting the information from:
35['jerry'] 20['bill']15['Dan']20['billy']