I have a dict {\'a\': 2, \'b\': 0, \'c\': 1}.
{\'a\': 2, \'b\': 0, \'c\': 1}
Need to sort keys by values so that I can get a list [\'b\', \'c\', \'a\']
[\'b\', \'c\', \'a\']
Is there a
>>> d={'a': 2, 'b': 0, 'c': 1} >>> [i[0] for i in sorted(d.items(), key=lambda x:x[1])] ['b', 'c', 'a']