← Back to archive

Stdle #11 · mutability · 2026-06-17

What does this Python snippet output?

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

def append_to(val, target=None):
if target is None:
target = []
target.append(val)
return target
print(append_to(1), append_to(2))
Mutability
4 attempts left

Answer & explanation