File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 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/
You can’t perform that action at this time.
0 commit comments