I am totally new to python there is something i can't understand in this code:
class Automobile():
numberOfWheels = 2
enginePower = 0
def __init__(self,**kwargs):
for i in kwargs:
self.i=kwargs[i]
1-this initializer suppose to create an instance attribute for each keyword argument passed to the Automobile() constructor? or i am missing something here?
2-if the above is correct ,testing the class give otherwise result:
>>>car=Automobile(numberOfWheels = 4, enginePower = 150)
>>>car.enginePower
0
as you can see the car object still refer to the Automobile class attribute what is going on?