You've already forked Curso-lenguaje-python
Update Python Ofensivo
This commit is contained in:
24
python-ofensivo/00_ejercicios/04_clase06.py
Normal file
24
python-ofensivo/00_ejercicios/04_clase06.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
|
||||
"""
|
||||
|
||||
|
||||
class Calculadora:
|
||||
|
||||
def __init__(self, numero):
|
||||
self.numero = numero
|
||||
|
||||
def suma(self, otro_numero):
|
||||
return self.numero + otro_numero
|
||||
|
||||
|
||||
def doble_suma(self, num1, num2):
|
||||
print(self.suma(num1) + self.suma(num2))
|
||||
|
||||
|
||||
calc = Calculadora(5)
|
||||
|
||||
print(calc.suma(8))
|
||||
|
||||
calc.doble_suma(5, 6)
|
||||
Reference in New Issue
Block a user