Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Car.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ def display_info(self):
def honk(self):
"""Specific implementation for a car."""
return "Honk honk!"
def open_trunk(self):
return "Trunk is now open."
16 changes: 16 additions & 0 deletions boat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from Vehicle import Vehicle

class Boat(Vehicle):
def __init__(self, brand, model, year, boat_type):
super().__init__(brand, model, year)
self.boat_type = boat_type

def display_info(self):
"""Override the parent class method for a Boat."""
return f"Boat: {self._brand} {self._model}, Type: {self.boat_type} ({self._year})"

def honk(self):
return "Honk!"

def anchor(self):
return "Anchoring the boat."