2/30
Part 1 of 7 · Score orderLearn and do

Sort by score, highest first, and settle ties by title

The catalog in every example of this lesson is the one from the prompt:

CATALOG = {"Orbit": 5, "Maple": 7, "Comet": 9, "Tundra": 3, "Harbor": 7}
print(sorted(CATALOG, key=lambda title: CATALOG[title], reverse=True))
Predict

Maple and Harbor both have 7. Which one does this sort put first?

Pick one to see what it prints.
Pick an answer above to see the rest