Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vehicle:
- brand = ""
- model = ""
- color = ""
- maxSpeed = ""
- def __init__(self, brand, model, color, maxSpeed):
- self.brand = brand
- self.model = model
- self.color = color
- self.maxSpeed = maxSpeed
- def start(self):
- print(f"{self.brand} {self.model} is starting the engine")
- def stop(self):
- print(f"{self.brand} {self.model} is stopping the engine")
- def turn(self, direction):
- print(f"{self.brand} {self.model} is turning {direction}")
- vehicle1 = Vehicle("Toyota", "Sedan", "Black", 300)
- vehicle1.start()
Advertisement
Add Comment
Please, Sign In to add comment