From d3dada27087f9172f040c170e0e06726e9e14167 Mon Sep 17 00:00:00 2001 From: cmoreno Date: Thu, 27 Aug 2026 09:04:28 -0300 Subject: [PATCH] clase 7 --- clase_7/main.py | 5 +++++ clase_7/ppo.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 clase_7/main.py create mode 100644 clase_7/ppo.py 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 + +