Skip to content

Commit

Permalink
PYTHON Retorno de valores de una funci贸n[57]馃悕馃憟馃憟馃憟
Browse files Browse the repository at this point in the history
  • Loading branch information
programadornovato committed Jul 7, 2020
1 parent 5f0adb8 commit 5afd0a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions funciones.py
@@ -1,9 +1,9 @@
def suma(n1,n2):
res=n1+n2
print(f"El resultado es {res}")
return float(res)
def resta(n1,n2):
res=n1-n2
print(f"El resultado es {res}")
return str(res)

#print("Hola desde la funcion print soy un parametro")
num1=10
Expand All @@ -15,9 +15,13 @@ def resta(n1,n2):
3.-Salir")
opcion=input()
if opcion=='1':
suma(num1,num2)
res=suma(num1,num2)
res=res+1
print(f"El resultado es:{res} tipo:{type(res)}")
elif opcion=='2':
resta(num1,num2)
res=resta(num1,num2)
res=res+1
print(f"El resultado es:{res} tipo:{type(res)}")
elif opcion=='3':
break
else:
Expand Down

0 comments on commit 5afd0a4

Please sign in to comment.