Question: Write a function sorted_dictionary() that takes a dictionary and returns a dictionary, sorted by its associated keys. For example, in the sample output below, since
Write a function sorted_dictionary() that takes a dictionary and returns a dictionary, sorted by its associated keys. For example, in the sample output below, since the key 'b' is the smallest value of all the keys, its value is the first dictionary entry. In contrast, the key 'wow' is the maximum of all the keys, so it is the last element of the sorted dictionary. sorted_dictionary({'wow':[1,2,3], 'b':'hello', 'm': ('Zebra', 30)}) it returns: {'b':'hello', 'm': ('Zebra', 30), 'wow':[1,2,3]}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
