1class HauntedMansion:
2 def __init__(self, **kwargs):
3 for key, value in kwargs.items():
4 self.__setattr__(key, value)
5
6 def __setattr__(self, key, value):
7 object.__setattr__(self, f"spooky_{key}", value)
8
9 def __getattr__(self, item):
10 return "Booooo, only ghosts here!"
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK