runtime
330 / 500
question 330 Decorators & Context Managers · hard

Predict: an error through three context managers

An error is raised inside three nested context managers: two class-based guards that each suppress one exception type, and a generator-based step with a finally. Predict exactly what this prints.

Watchthe order of the exits, which guard suppresses the KeyError, and which lines are skipped

Loading your progress…

Predict: an error through three context managers — Python practice · Runtime