Skip to content

Commit 0007301

Browse files
committed
Solucion pro
1 parent 7f26c4d commit 0007301

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Desarrollo/16_Solucion.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
class Perro():
2+
def __init__(self, nombre, color,raza):
3+
self.nombre = nombre
4+
self.color = color
5+
self.raza = raza
6+
self.comida = 10
7+
8+
def ladrar(self):
9+
return'El perro dice wuao wuao'
10+
11+
def comer(self, cantidad):
12+
self.comida = self.comida - cantidad
13+
return self.comida
14+
15+
16+
if __name__ == '__main__':
17+
perro = Perro('Lucas', 'Negro', 'Bulldog')
18+
19+
croquetas = int(input('¿Cuantas croquetas va a comer el perro? \n'))
20+
21+
if croquetas < 10:
22+
print('El perro comio '+str(croquetas)+' croquetas.'+'Ahora al Perro le quedan '+str(perro.comer(croquetas))+' croquetas.')
23+
else:
24+
print('¡El perro No puede comer tantas Croquetas!')
25+
26+
# https://platzi.com/comentario/2224673/

0 commit comments

Comments
 (0)