Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("CALCULADORA ESTUDIANTIL")
- a = True
- memoria = []
- while a:
- print("1 -- SUMA")
- print("2 -- RESTA")
- print("3 -- MULTIPLICACION")
- print("4 -- DIVISION")
- print("5 -- MOSTRAR MEMORIA")
- opcion = input("INGRESAR OPCION: ")
- print(" ")
- if opcion=="1":
- print("USTED SELECCIONO SUMA")
- numero_uno = int(input("INGRESE PRIMER NUMERO: "))
- numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
- print(" ")
- resultado = "LA OPERACION DE SUMA ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno+numero_dos)
- print(resultado)
- memoria.append(resultado)
- elif opcion=="2":
- print("USTED SELECCIONO RESTA")
- numero_uno = int(input("INGRESE PRIMER NUMERO: "))
- numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
- print(" ")
- resultado = "LA OPERACION DE RESTA ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno-numero_dos)
- print(resultado)
- memoria.append(resultado)
- elif opcion=="3":
- print("USTED SELECCIONO MULTIPLICACION")
- numero_uno = int(input("INGRESE PRIMER NUMERO: "))
- numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
- print(" ")
- resultado = "LA OPERACION DE MULTIPLICACION ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno*numero_dos)
- print(resultado)
- memoria.append(resultado)
- elif opcion=="4":
- print("USTED SELECCIONO DIVISION")
- numero_uno = int(input("INGRESE PRIMER NUMERO: "))
- numero_dos = int(input("INGRESE SEGUNDO NUMERO: "))
- print(" ")
- resultado = "LA OPERACION DE DIVISION ENTRE %s y %s es: " % (numero_uno,numero_dos)+str(numero_uno/numero_dos)
- print(resultado)
- memoria.append(resultado)
- elif opcion=="5":
- print("MEMORIA DE LA CALCULADORA: ")
- print(" ")
- for element in memoria:
- print(element)
- print(" ")
- else:
- print("OPCION INVALIDA")
- print(" ")
- print("1 -- SI")
- print("2 -- NO")
- b = input("DESEA CONTINUAR? ")
- print(" ")
- if b =="1":
- continue
- else:
- print(" ")
- print("ADIOS!")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement