[Solved] How to sort this list by the highest score?

[ad_1]

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

[ad_2]

solved How to sort this list by the highest score?