A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-77.py
1classTag:
2seen=[]
3x=Tag();y=Tag()
4x.seen=[1]
5y.seen.append(2)
6print(x.seen,y.seen,Tag.seen)
Classes
Answer & explanation
Console output
[1] [2] [2]
Why
Assigning x.seen = [1] creates an instance attribute that shadows the class list for x only. y never assigns, so y.seen is still Tag.seen; appending 2 mutates that shared list. Hence x.seen is [1] while both y.seen and Tag.seen are [2].