I have a 2D List -
[('John', 7), ('Max', 10), ('Sarah', 10), ('Tara', 7)]
which I would like to sort by number descending (highest first) and then name (alphabetical).
I have used this code -
highestscore = sorted(highestscore, key = lambda x: (x[1],x[0]), reverse=True)
but I get the result
[('Sarah', 10), ('Max', 10), ('Tara', 7), ('John', 7)]
Any ideas?