OOP 5: Parent - Child

OOP 5: Parent - Child

5.1. Create an ElectricCar class that inherits properties from the Car class.

5.2. Modify the __init__ method of the ElectricCar class so that it uses super() to call the __init__ method of the Car class.

5.3. Add a new attribute battery_capacity of type int to the ElectricCar class __init__ method. This attribute must be passing as argument. Put this argument before brand and model, because arguments without default values must go before ones that have.

5.4. Create a my_electric_car instance of the ElectricCar class, passing battery_capacity, brand, model with values 100, "Tesla", "Model 3" respectively.