Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- what = input("Что хотите сделать?: ")
- x = float(input("Введите первое число: "))
- y = float(input("Введите второе число: "))
- if what == "+":
- c = x + y
- print("Результат: " + str(c))
- elif what == "-":
- c = x - y
- print("Результат: " + str(c))
- elif what == "/":
- c = x / y
- print("Результат: " + str(c))
- if y == 0:
- print("Деление на 0!")
- elif what == "*":
- c = x * y
- print("Результат: " + str(c))
- elif what == "math.fmod":
- c = x % y
- print(str(c))
- elif what == "math.pow":
- c = x ** y
- print(str(c))
- else:
- print("Введена невозможная операция!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement