Untitled
Anonymous
plain_text
09/12/2023 9:06 AM
752 B
20
Indexable
def calculate():
num1 = float(input('Введите число: '))
num2 = float(input('Введите число: '))
operation = input("Введите действие (+, -, *, /): ")
if operation == "+":
result = num1 + num2
elif operation == "-":
result = num1 - num2
elif operation == "*":
result = num1 * num2
elif operation == "/":
result = num1 / num2
else:
print("Некорректный ввод")
return
print("результат:", result)Editor is loading...