You can use the sorted
function with the key
parameter to look at the 2nd item, and reverse
set to True
to sort in descending order.
>>> sorted(data_list, key = lambda i : i[1], reverse = True)
[['Jimmy', [8]], ['Reece', [8]], ['Zerg', [5]], ['Bob', [4]]]
2
solved How to sort this list by the highest score?