diff --git a/Bike.py b/Bike.py new file mode 100644 index 0000000..9f266df --- /dev/null +++ b/Bike.py @@ -0,0 +1,14 @@ +from Vehicle import Vehicle + +class Bike(Vehicle): + def __init__(self, brand, model, year, gears): + super().__init__(brand, model, year) + + def display_info(self): + """Override the parent class method for a Car.""" + return f"Bike: {self._brand} {self._model}, {self.gears} gears ({self._year})" + + def bell(self): + """Specific implementation for a car.""" + return "Ring ring!" + \ No newline at end of file diff --git a/Vehicle.py b/Vehicle.py index 260f28e..2818990 100644 --- a/Vehicle.py +++ b/Vehicle.py @@ -17,3 +17,6 @@ def fuel_up(self): def brake(self): print("Braking the car.") + + def park(self): + return "The car is at 0 mph now, and parked"