Проблема наследования....... Что я делаю
$ python python1.py Traceback (most recent call last): File "python1.py", line 674, in <module> smart_phone=Smart_phone("google","pixal 5","88000","8","12","touch_screen") File "python1.py", line 668, in __init__ super().__init__(self,ram,rear_camera,screen) TypeError: __init__() takes 4 positional arguments but 5 were given
Что я уже пробовал:
class phone: def __init__(self,brand,model,price): self.brand=brand self.model=model self.price=price def full_name(self): return f"{self.brand} and {self.model}" class Smart_phone(phone): def __init__(self,brand,model,price,ram,rear_camera,screen): super().__init__(self,ram,rear_camera,screen) self.ram=ram self.rear_camera=rear_camera self.screen=screen def full_name(self): return f"{self.brand} and {self.model} and " smart_phone=Smart_phone("google","pixal 5","88000","8","12","touch_screen") phone=phone("nokia",1100,1000) # print(phone.full_name()) print(smart_phone.full_name())