given this code :
class body:
a = 10
def __init__(self, sasiu, roti, Caroserie, motor):
self.sasiu = sasiu
self.roti = roti
self.Caroserie = Caroserie
self.motor = motor
class actiuni:
def move(self, direction, speed, status):
if status.lower() == 'start':
print('Masina a pornit')
if direction == 'inainte':
print(f'Masina a inaintat cu vitaza de {speed} km\\h')
elif direction == 'inapoi':
print(f'Masina a a mers cu spatele cu vitaza de {speed} km\\h')
elif status.lower() == 'stop':
print('Masina s-a oprit')
class DetaliiMarketing:
def __init__(self, marca, model, culoare):
self.marca = marca
self.model = model
self.culoare = culoare
class masina(body, actiuni, DetaliiMarketing):
def __init__(self, sasiu, roti, Caroserie, motor, marca, model, culoare):
super(masina, self).__init__(sasiu=sasiu, roti=roti, Caroserie=Caroserie, motor=motor, marca=marca, model=model, culoare=culoare)
self.myCar = {}
def createCar(self):
self.myCar = {'sasiu': self.sasiu,
'roti': self.roti,
'Caroserie': self.Caroserie,
'motor': self.motor,
'marca': self.marca,
'model': self.model,
'culoare': self.culoare
}
passatObj = masina('B6', '4', 'Sedan', '240HPTwinTurboSuperChargeDiesel', 'VolksWagen', 'B6', 'MocaBrown')
passatObj.createCar()
print(passatObj.myCar)
I'm trying to create a car object that inherits from body and actiuni class, but when i'm trying to pass init params, a typeError is returned.
Error returned:
TypeError: init() got an unexpected keyword argument 'marca'