leaderboard(scores) that converts a dict of player → score into a list of 'player: score' strings ordered by score descending, ties broken alphabetically — sorted on .items() with a lambda key, then a formatting pass.leaderboard({'ana': 300, 'raj': 450, 'kim': 300})['raj: 450', 'ana: 300', 'kim: 300']
raj leads; ana beats kim alphabetically at 300.
key=lambda kv: (-kv[1], kv[0]).
f-strings for the final format.