Mastery check
Learn~1 min

Which line crashes?

menu is the dict below. Which one of these lines raises an error?

menu = {'tea': 4, 'cake': 5}

Reminder

Reading a missing key with [] crashes. Asking with in never crashes. Assigning a missing key just adds it.

No labels here: choosing the approach is part of what this tests. The skills it trains show once you pass.

Choose
Choose one answer