Advertisement
teslariu

ejemplo

Mar 27th, 2021
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. """
  5. Calculadora que pide dos nros e imprime el resultado de las 4 operaciones
  6. básicos
  7. """
  8. from aritmetica import suma as s, resta as r
  9. from aritmetica import ingresar_numero
  10.            
  11. while True:
  12.     x = ingresar_numero()
  13.     y = ingresar_numero()
  14.    
  15.     print(f"a + b = {s(x,y)}")
  16.     print(f"a - b = {r(x,y)}")
  17.  
  18.     opcion = input("Presione cualquier tecla para continuar (o 'x' para salir): ")
  19.     if opcion == "x":
  20.         print("Gracias por usar este programa...")
  21.         break
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement