← Back to archive

Stdle #174 · scope · 2026-11-27

What does this Python snippet output?

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

x = "global"
def outer():
x = "enclosing"
def inner():
return x
return inner()
print(outer())
Scope
4 attempts left

Answer & explanation