← Back to archive

Stdle #176 · iteration · 2026-11-29

What does this Python snippet output?

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

it = iter([10, 20])
print(next(it, -1))
print(next(it, -1))
print(next(it, -1))
Iteration
3 lines
4 attempts left

Answer & explanation