Python exercise · about 5 minutes · free
enumerate and zip: Ranked Scoreboard
Two lists that belong together, and you need the rank too. No index juggling required.
zip(a, b) pairs items from two lists. enumerate(items, start=1) numbers them. Together they replace most range(len(...)) loops.
Your quest: Build
lines like "1. Zed - 500" from names and scores, ranked from 1.Starter code
names = ["Zed", "Mia", "Kai"] scores = [500, 340, 120] lines = []