diff --git a/clase_7/main.py b/clase_7/main.py new file mode 100644 index 0000000..6e3ccc5 --- /dev/null +++ b/clase_7/main.py @@ -0,0 +1,5 @@ +from ppo import Auto + +auto_1 = Auto ("Verde","Renault","clio", 100) + +print(auto_1.getVelocidad()) \ No newline at end of file diff --git a/clase_7/ppo.py b/clase_7/ppo.py new file mode 100644 index 0000000..741ee97 --- /dev/null +++ b/clase_7/ppo.py @@ -0,0 +1,29 @@ +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 + +