>>> ds = {'a': 3, 'b': 2, 'c': 1, 'd': 0} >>> sorted(ds.items(), key=lambda v: v[1]) [('d', 0), ('c', 1), ('b', 2), ('a', 3)]
>>> import operator >>> sorted(ds.items(), key=operator.itemgetter(1)) [('d', 0), ('c', 1), ('b', 2), ('a', 3)]