saving work on further inheritance practice

This commit is contained in:
2022-07-01 12:04:35 -05:00
parent 5ea0c79860
commit ebb249f595
+4 -1
View File
@@ -89,7 +89,10 @@ class semi_Truck(GroundVehicle):
self.noOfTrailersAttached = _noOfTrailersAttached
def displayNoOfTrailersAttached(self):
print(self.noOfTrailersAttached)
def travel(self):
print("Currently unloading")
Semi_Truck1 = semi_Truck(f"This truck has {2} trailers attached.")
semi_Truck.displayNoOfTrailersAttached()
# Remember to be careful to check that you are running the method on an instance of the class, not on the class definition.
Semi_Truck1.displayNoOfTrailersAttached()