Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.22 KB | None | 0 0
  1.  
  2. print("CALCULADORA ESTUDIANTIL")
  3. a = True
  4. memoria = []
  5. while a:
  6.     print("1 -- SUMA")
  7.     print("2 -- RESTA")
  8.     print("3 -- MULTIPLICACION")
  9.     print("4 -- DIVISION")
  10.     print("5 -- MOSTRAR MEMORIA")
  11.     opcion = input("INGRESAR OPCION: ")
  12.     print(" ")
  13.     if opcion=="1":
  14.         print("USTED SELECCIONO SUMA")
  15.         numero_uno = int(input("INGRESE PRIMER NUMERO: "))
  16.         numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
  17.         print(" ")
  18.         resultado = "LA OPERACION DE SUMA ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno+numero_dos)
  19.         print(resultado)
  20.         memoria.append(resultado)
  21.     elif opcion=="2":
  22.         print("USTED SELECCIONO RESTA")
  23.         numero_uno = int(input("INGRESE PRIMER NUMERO: "))
  24.         numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
  25.         print(" ")
  26.         resultado = "LA OPERACION DE RESTA ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno-numero_dos)
  27.         print(resultado)
  28.         memoria.append(resultado)
  29.     elif opcion=="3":
  30.         print("USTED SELECCIONO MULTIPLICACION")
  31.         numero_uno = int(input("INGRESE PRIMER NUMERO: "))
  32.         numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
  33.         print(" ")
  34.         resultado = "LA OPERACION DE MULTIPLICACION ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno*numero_dos)
  35.         print(resultado)
  36.         memoria.append(resultado)
  37.     elif opcion=="4":
  38.         print("USTED SELECCIONO DIVISION")
  39.         numero_uno = int(input("INGRESE PRIMER NUMERO: "))
  40.         numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
  41.         print(" ")
  42.         resultado = "LA OPERACION DE DIVISION ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno/numero_dos)
  43.         print(resultado)
  44.         memoria.append(resultado)
  45.     elif opcion=="5":
  46.         print("MEMORIA DE LA CALCULADORA: ")
  47.         print(" ")
  48.         for element in memoria:
  49.             print(element)
  50.             print(" ")
  51.     else:
  52.         print("OPCION INVALIDA")
  53.     print(" ")
  54.     print("1 -- SI")
  55.     print("2 -- NO")
  56.     b = input("DESEA CONTINUAR? ")
  57.     print(" ")
  58.     if b =="1":
  59.         continue
  60.     else:
  61.         print(" ")
  62.         print("ADIOS!")
  63.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement