If anybody could assist me that would be great. I've been trying to print a high scores list and every method I've tried to sort the scores isn't working and I don't understand what I keep doing wrong.
def show_high_scores():
"""
shows top 5 highest scores to the user
"""
scores_col = SHEET.worksheet('high_scores').col_values(2)
scores_data = scores_col[1:]
sorted_scores = sorted(scores_data, reverse=True)
names_col = SHEET.worksheet('high_scores').col_values(1)
names_data = names_col[1:]
print('\nHigh Scores\n')
for i in range(5):
print(str(names_data[i]) + "\t" + str(sorted_scores[i]))