From ebb249f595db115cb3cf7e726d5237f216c33ccb Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Fri, 1 Jul 2022 12:04:35 -0500 Subject: [PATCH] saving work on further inheritance practice --- fleet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fleet.py b/fleet.py index 5c6bb94..c785033 100644 --- a/fleet.py +++ b/fleet.py @@ -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() \ No newline at end of file +# 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() \ No newline at end of file