Hi Guys,
Screen Link:
https://app.dataquest.io/m/1018/lists/20/sorting-lists-of-lists-ii
I came up with this solution and even though the result is exactly how its shown the solution is not validated as correct when I click “Submit Answer”.
Anything I am doing wrong?
def sort_index(input_list):
input_list.sort()
input_list.sort(key=lambda x: x[2], reverse=True)
sort_index(grades)
print(*grades, sep="\n")
I got the following as the output:
['Dieter', 'Male', 'F']
['Jelle', 'Male', 'F']
['Lode', 'Male', 'F']
['Martijn', 'Male', 'F']
['Weston', 'Male', 'F']
['Adam', 'Male', 'D']
['Madeeha', 'Female', 'D']
['Mari', 'Female', 'D']
['Sue', 'Female', 'D']
['Alex', 'Male', 'A']
['Bruno', 'Male', 'A']
['Casey', 'Male', 'A']
['François', 'Male', 'A']
['John', 'Male', 'A']
['Joshua', 'Male', 'A']
['Julie', 'Female', 'A']
['Rebecca', 'Female', 'A']
['Renny', 'Male', 'A']