rank_players(scores), where scores is a list of (player_name, points) tuples. Return a new list sorted by points descending, breaking ties alphabetically by player_name ascending. Use sorted() with a key function.rank_players([('Zoe', 10), ('Amit', 15), ('Bo', 15)])[('Amit', 15), ('Bo', 15), ('Zoe', 10)]Amit and Bo tie on 15 points and are ordered alphabetically; Zoe trails on 10.
sorted(scores, key=lambda t: (-t[1], t[0])) sorts by descending points, then ascending name.