I have a dict where each key references an int value. What's the best way to sort the keys into a list depending on the values?
I have a dict where each key references an int value. What's the best way to sort the keys into a list depending on the values?
>>> mydict = {'a':1,'b':3,'c':2}
>>> sorted(mydict, key=lambda key: mydict[key])
['a', 'c', 'b']