← Back to archive

Stdle #139 · modern · 2026-10-23

What does this Python snippet output?

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

def make():
n = 0
def step():
n += 1
return n
return step
s = make()
try:
print(s())
except UnboundLocalError:
print("UnboundLocalError")
Modern
4 attempts left

Answer & explanation