Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CAR:
- def __init__(self,model,price,color):
- self._model = model
- self.price = price
- self.color = color
- def setModel(self,model):
- self._model = model
- def setColor(self,color):
- self.color = color
- def setPrice(self,price):
- self.price = price
- def getModel(self):
- return self._model
- def getColor(self):
- return self.color
- def getPrice(self):
- return self.price
- class EV(CAR):
- def __init__(self,model,price,color,max_dist):
- super().__init__(model,price,color)
- self._max_dist = max_dist
- def getMaxDist(self):
- return self._max_dist
- tesla = EV('Tesla',200000,'white',1000)
- print(tesla.getModel())
- print(tesla.getMaxDist())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement