01 / 07
The shape you wrote by hand in chapter 2
"Find whoever scored highest." You may remember doing it in the chapter 2 review.
Make the first one the winner for now, and swap whenever something beats it. That was the shape.
Being able to write it matters, but writing it out every time is a chore.
register = [ {"name": "Yui", "score": 90}, {"name": "Haruto", "score": 60}, {"name": "Minato", "score": 75},]best = register[0]for person in register: if person["score"] > best["score"]: best = personprint(best["name"])Result
Yui