have inheritance and interface example complete

This commit is contained in:
2022-06-30 13:41:47 -05:00
parent c2a19262b7
commit 7c5cd3748a
+4 -1
View File
@@ -66,6 +66,9 @@ class Train(GroundVehicle):
def displayCarCount(self):
print(self.noOfCarsAttached)
def travel(self):
print("Speed 60mph, Direction E")
Train1 = Train(20, 2)
Train.displayCarCount()
Train1.displayCarCount()