← Back to archive

Stdle #131 · scope · 2026-10-15

What does this Python snippet output?

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

rows = [[1, 2], [3, 4]]
flat = [v for row in rows for v in row]
print(flat)
try:
print(row)
except NameError as e:
print(type(e).__name__)
Scope
2 lines
4 attempts left

Answer & explanation