I am writing a small text game. I keep getting an error while trying to define a class variable.
Here's the class code:
class Scenery(): def __init__(self,name,description): self.name=name self.description=description class Door(Scenery): def __init__(self,openstatus,lockstatus): self.openstatus=openstatus self.lockstatus=lockstatus super().__init__(name,description,openstatus,lockstatus) class CageDoor(Door): def __init__(self): super().__init__(lockstatus=False, openstatus=False, name="Cage Door", description="It the door to the cage.")
Code main.py:
from tiles import CageDoor CageDoor = CageDoor()
And the error:
File "main.py", line 3, in <module> CageDoor = CageDoor() *File Location* name="Cage Door" TypeError: __init__() got an unexpected keyword argument 'name'
source share