From 169dff4ab2724a0b75d750b38c641d85ae1f4378 Mon Sep 17 00:00:00 2001 From: Julia Ribeiro Date: Wed, 27 Nov 2024 09:55:30 -0500 Subject: [PATCH 1/3] Add Bicycle class --- Bicycle | 18 ++++++++++++++++++ Vehicle.py | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 Bicycle diff --git a/Bicycle b/Bicycle new file mode 100644 index 0000000..6956fa6 --- /dev/null +++ b/Bicycle @@ -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 From c147d44b6ebb3e0426f44de96f868ac22e67c09c Mon Sep 17 00:00:00 2001 From: Julia Ribeiro Date: Wed, 27 Nov 2024 09:58:52 -0500 Subject: [PATCH 2/3] Add Bicycle class --- Bicycle.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Bicycle.py 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 From eb48d791b3da5b5f5ffc2ae3ab838aee3e859f18 Mon Sep 17 00:00:00 2001 From: Juliarriibeiro <97930935+Juliarriibeiro@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:59:29 -0500 Subject: [PATCH 3/3] Delete Bicycle --- Bicycle | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Bicycle diff --git a/Bicycle b/Bicycle deleted file mode 100644 index 6956fa6..0000000 --- a/Bicycle +++ /dev/null @@ -1,18 +0,0 @@ -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