← Back to archive

Stdle #61 · scope · 2026-08-06

What does this Python snippet output?

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

x = 1
def f():
print(x)
print(x)
f()
x = 2
f()
Scope
3 lines
4 attempts left

Answer & explanation