Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class vehicle:
- def __init__(self,seats, horsepower, weight, gearboxType, color, fuel ):
- self._seats = str(seats)
- self._horsepower = int(horsepower)
- self._weight = int(weight)
- self._gearboxType = str(gearboxType)
- self._color = str(color)
- self._fuel = str(fuel)
- def accelerate(self):
- """accelerate"""
- def stop(self):
- """stop"""
- class bat_speedster(vehicle):
- def open_close_roof(self):
- """open_close_roof"""
- class bat_suv(vehicle):
- def switch_4x4(self):
- """switch_4x4"""
- class bat_limousine(vehicle):
- def recharge(self):
- """recharge"""
- car1 = bat_speedster("2 sport",320,1600,"manual","red","gasoline")
- car1.accelerate()
- car1.stop()
- car2 = bat_suv("7 basic", 150, 1850,"automatic", "blue", "diesel")
- car2.accelerate()
- car2.stop()
- car3 = bat_limousine("5 leather", 260, 2100, "automatic", "gray", "electric car")
- car3.accelerate()
- car3.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement