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
6 changes: 5 additions & 1 deletion Car.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from Vehicle import Vehicle

class Car(Vehicle):
def __init__(self, brand, model, year, doors):
def __init__(self, brand, model, year, doors, miles_driven):
super().__init__(brand, model, year)
self.doors = doors
self.miles_driven=miles_driven

def display_info(self):
"""Override the parent class method for a Car."""
Expand All @@ -12,3 +13,6 @@ def display_info(self):
def honk(self):
"""Specific implementation for a car."""
return "Honk honk!"

def miles_driven(self):
return f"{self.miles_driven}"
14 changes: 14 additions & 0 deletions Jeep.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from Vehicle import Vehicle

class Jeep(Vehicle):
def __init__(self, brand, model, year, wheels):
super().__init__(brand, model, year)
self.wheels = wheels

def display_info(self):

return f"Jeep: {self._brand} {self._model}, Wheels: {self.wheels}, ({self._year})"

def honk(self):

return "BRRRRRR!"