← Back to archive

Stdle #16 · iteration · 2026-06-22

What does this Python snippet output?

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

def count():
n = 0
while True:
n += 1
yield n
c = count()
print(next(c), next(c), next(c))
Iteration
4 attempts left

Answer & explanation