← Back to archive

Stdle #85 · scope · 2026-08-30

What does this Python snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

x = 10
def f():
print(x)
x = 20
try:
f()
except UnboundLocalError as e:
print(type(e).__name__)
Scope
4 attempts left

Answer & explanation