Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import operator
- ops = {"+" : operator.add,\
- "-" : operator.sub,\
- "*" : operator.mul,\
- "**" : operator.pow,\
- "/" : operator.truediv,\
- "//" : operator.floordiv}
- print ("Введите первое значение")
- a = int(input())
- print ("Введите второе значение")
- b = int(input())
- print ("Введите одну из операций: + - * ** / //")
- op = input()
- y = ops [op](a,b)
- print("")
- print("=",y)
- print("")
- print("""Хотите продолжить работу с этой переменной/Выбрать новую/Выйти из программы?
- Продолжить/Новая/Выйти
- """)
- answer1 = input()
- while answer1 == ("Продолжить"):
- print("Введите одну из операций: + - * ** / //")
- op = input()
- print("Введите второе значение")
- b = int(input())
- y = ops [op](y,b)
- print("")
- print("=",y)
- print("""Хотите продолжить работу с этой переменной/Выбрать новую/Выйти из программы?
- Продолжить/Новая/Выйти
- """)
- answer1 = input()
- while answer1 == ("Новая"):
- print ("Введите первое значение")
- a = int(input())
- print ("Введите второе значение")
- b = int(input())
- print ("Введите одну из операций: + - * ** / //")
- op = input()
- y = ops [op](a,b)
- print("")
- print("=",y)
- print("")
- print("""Хотите продолжить работу с этой переменной/Выбрать новую/Выйти из программы?
- Продолжить/Новая/Выйти
- """)
- answer1 = input()
- while answer1 == ("Выйти"):
- print ("""
- До свидания""")
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement