Skip to content

Instantly share code, notes, and snippets.

@Irvingutierrez
Created May 7, 2015 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Irvingutierrez/eee77481c55d297d2558 to your computer and use it in GitHub Desktop.
Save Irvingutierrez/eee77481c55d297d2558 to your computer and use it in GitHub Desktop.
WSQ08
print("Fun with numbers")
print()
x=int(input("Introduce un numero "))
y=int(input("Introduce otro numero "))
print()
def sum_num(a,b):
r=a+b
print("La suma de los numeros es ", r)
def res_num(a,b):
r=a-b
print("La resta de los numeros es ", r)
def mult_num(a,b):
r=a*b
print("La multiplicacion de los numeros es ", r)
def div_num(a,b):
r=int(x/y)
print("La division de los numeros es ", r)
def mod_num(a,b):
r=int(x%y)
print("El sobrante de los numeros es ", r)
suma= sum_num(x,y)
res= res_num(x,y)
mult= mult_num(x,y)
div= div_num(x,y)
mod= mod_num(x,y)
print()
print("Fun with numbers")
print()
x=int(input("Introduce un numero "))
y=int(input("Introduce otro numero "))
def sum_num(a,b):
r=a+b
return r
def res_num(a,b):
r=a-b
return r
def mult_num(a,b):
r=a*b
return r
def div_num(a,b):
r=int(x/y)
return r
def mod_num(a,b):
r=int(x%y)
return r
suma= sum_num(x,y)
res= res_num(x,y)
mult= mult_num(x,y)
div= div_num(x,y)
mod= mod_num(x,y)
print()
print("La suma de los numeros es ", suma)
print("La resta de los numeros es ", res)
print("La multiplicacion de los numeros es ", mult)
print("La division de los numeros es ", div)
print("El sobrante de los numeros es ", mod)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment