min and max of dict values

>>> vals={"a": 2, "b":3, "c": 4}

>>> min(vals, key=lambda x: vals[x])
'a'

Last updated