Есть массив
[(1, {'sums': 2}), (2, {'sums': 25}), (3, {'sums': 5}), (2, {'sums': 2}), (2, {'sums': 30})]
Спасибо!
[(1, {'sums': 2}), (2, {'sums': 25}), (3, {'sums': 5}), (2, {'sums': 2}), (2, {'sums': 30})]
...
>>> x = [(1, {'sums': 2}), (2, {'sums': 25}), (3, {'sums': 5}), (2, {'sums': 2})
, (2, {'sums': 30})]
>>> y = sorted(x, key = lambda item:item[1]['sums'], reverse = True)
>>> print y
[(2, {'sums': 30}), (2, {'sums': 25}), (3, {'sums': 5}), (1, {'sums': 2}), (2, {'sums': 2})]
>>>
...