Question: please use python! and this diagram was given: Implement an __init__ method that: calls the Vehicle __init__ method with super( ).__init__ to initialize the variables
please use python! and this diagram was given:
Implement an __init__ method that:
- calls the Vehicle __init__ method with super( ).__init__ to initialize the variables in the base class;
- initialize the instance variables make, model, num_cylinders, and accessories;
- initialize miles to 0;
- initialize accessories to the empty list.
THIS IS MY CODE SO FAR PLEASE HELP! I need to initialize miles to 0 and initialize accessories to the empty list.
class Automobile(Vehicle):
def __init__(self, vin, year, color, owner, make, model, num_cylinders): super( ).__init__(vin, year, color, owner) self.make = make self.model = model self.num_cylinders = num_cylinders
Vehicle + vin : str + year: int + color: str + owner: str - sales_tax_paid: bool - _init_(vin: str, year: int color: str, owner: str) + is_sales_tax_paid): bool + pay_sales_tax -_str_0 : str Automobile + make : str + model : str + num_cylinders: int + miles : int + accessories : str[] + __init__(vin: str, year: int color: str, make : str, model : str. num_cylinders: int miles: int) + add_miles(the_miles :int) + add_accessory(the_item: str) -_str_0: str - repr_0: str -_It_0:boolStep by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
