- 3
Sort a dictionary in alphabetical order by the value, and print.
1. Sorting Dictionaries: âą Create a dictionary of 20 humans and their pets (name of human is the key, and name of pet is the value). âą Sort the dictionary in alphabetical order by the key, and print. âą Sort the dictionary in alphabetical order by the value, and print.
2 RĂ©ponses
+ 4
I see that you seem to be asking how to sort a dictionary only by the value, but the task 1st requires you to sort by the key and then again by the value. Where is your coded attempt? Depending on how/if you coded the 1st sorted part by the key, you may be able to sort by value in a similar way. Share your attempt and we can help you further.
+ 3
This looks like homework!
Do you have an attempt to post with your query?