10 lines
344 B
Python
10 lines
344 B
Python
def calculator():
|
|
operation = input("Введите операцию (+ или *): ")
|
|
num1 = float(input("первое число: "))
|
|
num2 = float(input("второе число: "))
|
|
if operation == '+':
|
|
result = num1 + num2
|
|
elif operation == '*':
|
|
|
|
result = num1 * num2
|
|
print(f"Результат: {result}") |