diff --git a/Tesla.py b/Tesla.py new file mode 100644 index 0000000..a465496 --- /dev/null +++ b/Tesla.py @@ -0,0 +1,20 @@ +from Vehicle import Vehicle + +class Tesla(Vehicle): + def __init__(self, brand, model, year, doors): + super().__init__(brand, model, year) + self.doors = doors + + def display_info(self): + """Override the parent class method for a Car.""" + return f"Car: {self._brand} {self._model}, {self.doors} doors ({self._year})" + + def honk(self): + """Specific implementation for a car.""" + return "Honk honk!" + + def fuel_type(self): + return "Electric" + + def transmission(self): + return "None" diff --git a/Vehicle.py b/Vehicle.py index 260f28e..b8d1401 100644 --- a/Vehicle.py +++ b/Vehicle.py @@ -14,6 +14,9 @@ def honk(self): def fuel_up(self): return "Full tank" + + def windshield_fluid(self): + return "Windshield fluid empty." def brake(self): print("Braking the car.")