Question: Given the dictionary people below, sort the dictionary on age. Print the sorted result as a list of tuples as shown below. You must sort

Given the dictionary people below, sort the dictionary on age. Print the sorted result as a list of tuples as shown below. You must sort the people dictionary directly, i.e., people must be passed to sorted. This means that you may not transform the dictionary into another data structure and sort that data structure. Hint: Sorting the people dictionary without any parameters will result in a list of names sorted on name. people['Jack'] retrieves {'age': 19, 'position':'student'}. people['Jack']['age'] retrieves 19

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!