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:

  1. calls the Vehicle __init__ method with super( ).__init__ to initialize the variables in the base class;
  2. initialize the instance variables make, model, num_cylinders, and accessories;
  3. initialize miles to 0;
  4. 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:bool

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!