Practice ยท 2 of 4
Catch the Right Thing
CHALLENGE
Difficulty: beginner+25 XP
Write fetch_score(data) that returns data["score"] as an int, but returns -1 when the key is missing. Do NOT catch every exception โ catch only the one that a missing key raises.
Press Submit to check your solution.
Back to lesson: Practice: Traceback Reading