Advertisement
teslariu

modulo aritmetica

Feb 4th, 2023
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # modulo con funciones propias
  4. def sumar(a,b):
  5.     return a+b
  6.    
  7. def restar(a,b):
  8.     return a - b
  9.    
  10. def multiplicar(a,b):
  11.     return a*b
  12.    
  13. def dividir(a,b):
  14.     if not b:
  15.         return "No se puede dividir por cero"
  16.     else:
  17.         return a/b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement