← Back to archive

Stdle #135 · mutability · 2026-10-19

What does this Python snippet output?

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

d = {}
for c in "abca":
d.setdefault(c, []).append(1)
print({k: len(v) for k, v in d.items()})
Mutability
4 attempts left

Answer & explanation