Your question is Sort Dictionary by Age. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Accenture España needs a consistently ordered view of staff records for an internal Python utility. Given a dictionary mapping each person's name to their age, return a new dictionary ordered by age from highest to lowest.
Do not modify the original dictionary. If multiple people have the same age, preserve their original insertion order. Python dictionaries preserve insertion order, so the returned dictionary's iteration order represents the required result.
Implement sort_by_age(people), where:
people is a dictionary with unique string names as keys and integer ages as values.people.def sort_by_age(people):