diff --git a/Bicycle.py b/Bicycle.py new file mode 100644 index 0000000..6956fa6 --- /dev/null +++ b/Bicycle.py @@ -0,0 +1,18 @@ +from Vehicle import Vehicle + +class Bicycle(Vehicle): + def __init__(self, brand, model, year, gear_count): + super().__init__(brand, model, year) + self.gear_count = gear_count + + def display_info(self): + """Override the parent class method for a Bicycle.""" + return f"Bicycle: {self._brand} {self._model}, Gears: {self.gear_count} ({self._year})" + + def ring_bell(self): + """Specific implementation for a bicycle.""" + return "Ring ring!" + + def pedal(self): + """Simulate pedaling the bicycle.""" + return "Keep pedaling! You rock!!" \ No newline at end of file diff --git a/Vehicle.py b/Vehicle.py index 260f28e..332cd5c 100644 --- a/Vehicle.py +++ b/Vehicle.py @@ -17,3 +17,6 @@ def fuel_up(self): def brake(self): print("Braking the car.") + + def check_maintenance(self): + return f"{self._brand} {self._model} needs a checkup soon!" \ No newline at end of file