← Back to challenges

Who's The Oldest?

PythonHarddata_structuresobjectslanguage_fundamentals

Instructions

Given a dictionary containing the names and ages of a group of people, return the name of the oldest person.

Examples

oldest({
  "Emma": 71,
  "Jack": 45,
  "Amy": 15,
  "Ben": 29
}) ➞ "Emma"

oldest({
  "Max": 9,
  "Josh": 13,
  "Sam": 48,
  "Anne": 33
}) ➞ "Sam"

Notes

All ages will be different.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Recursion: GCD