Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- def ingresar_numero():
- while True:
- try:
- n = float(input("Ingrese un numero: "))
- except ValueError:
- print("Debe ingresar un nro")
- else:
- return n
- def sumar(a,b):
- return a+b
- def multiplicar(a,b):
- return a*b
- if __name__ == '__main__':
- print(f"2 + 3 = {sumar(2,3)}")
- print(f"2 x 3 = {multiplicar(2,3)}")
Advertisement
Add Comment
Please, Sign In to add comment