This commit is contained in:
cmoreno 2026-08-27 09:04:28 -03:00
parent 6aa87585a6
commit d3dada2708
2 changed files with 34 additions and 0 deletions

5
clase_7/main.py Normal file
View File

@ -0,0 +1,5 @@
from ppo import Auto
auto_1 = Auto ("Verde","Renault","clio", 100)
print(auto_1.getVelocidad())

29
clase_7/ppo.py Normal file
View File

@ -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