MCPcopy Index your code
hub / github.com/LinkedInLearning/learning-python-2896241 / Motorcycle

Class Motorcycle

Ch2 - Basics/classes_finished.py:27–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27class Motorcycle(Vehicle):
28 def __init__(self, enginetype, hassidecar):
29 super().__init__("Motorcycle")
30 if (hassidecar):
31 self.wheels = 2
32 else:
33 self.wheels = 3
34 self.doors = 0
35 self.engine = enginetype
36
37 def drive(self, speed):
38 super().drive(speed)
39 print("Driving my", self.engine, "motorcylce at ", self.speed)
40
41
42car1 = Car("gas")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected