I have the following dictionary, sorted ascendingly by value.
>>> x = {'foo': 2.01, 'bar': 4.11, 'qux':3.2, 'ail':1.2, 'dfa':0.03}
>>> sorted_x = sorted(x.iteritems(), key=operator.itemgetter(1))
>>> sorted_x
[('dfa', 0.029999999999999999), ('ail', 1.2), ('foo', 2.0099999999999998), ('qux', 3.2000000000000002), ('bar', 4.1100000000000003)]
How can I do sort it descendingly by value? I tried this but prints nothing
>>> sorted_x.reverse()
>>>