A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-67.py
1classW:
2def__str__(self):return"W-str"
3def__repr__(self):return"W-repr"
4d={"k":W()}
5print(d)
Classes
Answer & explanation
Console output
{'k': W-repr}
Why
Printing a dict uses the dict repr, which renders both keys and values with repr(). So the value is shown via __repr__ ("W-repr"), not __str__, and the string key keeps its quotes. Containers never use __str__ on their contents.