Python Forum

Full Version: Writing a lambda function that sorts dictionary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys! :)

dict1 = {'c':3, 'a':5, 'f':7, 'e':4}
Was wandering how to sort this dictionary by highest value first using lambda function?

expected result:
dict2 = {'f':7, 'a':5, 'e':4, 'c':3}
Appreciate the help !