30 lines
535 B
Python
30 lines
535 B
Python
class Auto:
|
|
color= "amarillo"
|
|
marca= "fiat"
|
|
modelo= "toro"
|
|
velocidad= 120
|
|
|
|
def __init__(self,color,marca,modelo,velocidad):
|
|
self.color=color
|
|
self.marca=marca
|
|
self.modelo= modelo
|
|
self.velocidad= velocidad
|
|
|
|
|
|
def acelerar(self):
|
|
self.velocidad +=1
|
|
|
|
def frenar(self):
|
|
self.velocidad -= 1
|
|
|
|
def getVelocidad(self):
|
|
return self.velocidad
|
|
|
|
def setColor(self, color):
|
|
self.color= color
|
|
|
|
def getColor(self):
|
|
return self.color
|
|
|
|
|