← Back to archive

Stdle #140 · iteration · 2026-10-24

What does this Python snippet output?

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

it = iter(range(10))
import itertools
head = list(itertools.islice(it, 3))
print(head)
print(next(it))
Iteration
2 lines
4 attempts left

Answer & explanation