← Back to archive

Stdle #47 · scope · 2026-07-23

What does this Python snippet output?

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

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

Answer & explanation