Untitled

 avatar
unknown
plain_text
2 years ago
562 B
7
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...