← Back to archive

Stdle #54 · scope · 2026-07-30

What does this Python snippet output?

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

def outer():
n = 1
def inner():
nonlocal n
n += 10
inner()
return n
print(outer())
Scope
4 attempts left

Answer & explanation