Skip to content

Commit bcd77eb

Browse files
committed
emma
1 parent c688e1a commit bcd77eb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

ObjetosPractica.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from os import path
2+
3+
4+
class Auto:
5+
def __init__(self, marca, modelo, anio, color):
6+
self.marca = marca
7+
self.modelo = modelo
8+
self.anio = anio
9+
self.color = color
10+
self.velocidad_actual = 0
11+
12+
def acelerar(self, velocidad):
13+
self.velocidad_actual += velocidad
14+
def frenar(self, velocidad):
15+
self.velocidad_actual -= velocidad
16+
def obtener_velocidad_actual(self):
17+
return self.velocidad_actual
18+
19+
mi_auto = Auto('bmw', '325i', '1993', 'gris')
20+
21+
mi_auto.acelerar(15)
22+
23+
mi_auto.obtener_velocidad_actual()
24+
25+
sys path

0 commit comments

Comments
 (0)