← Back to archive

Stdle #59 · scope · 2026-08-04

What does this Python snippet output?

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

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

Answer & explanation