Open jbyrne99 opened 6 years ago
How do you sort within a dictionary like we just did with lists?
To sort by the keys you can use sorted(name_of_dict.keys()) but if you wanted to sort by the values you can use sorted(name_of_dict.values()) .
sorted(name_of_dict.keys())
sorted(name_of_dict.values())
How do you sort within a dictionary like we just did with lists?