Загрузить файлы в «/»
This commit is contained in:
commit
fb7d181e2e
10
calcu.py
Normal file
10
calcu.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
def calculator():
|
||||||
|
operation = input("Введите операцию (+ или *): ")
|
||||||
|
num1 = float(input("первое число: "))
|
||||||
|
num2 = float(input("второе число: "))
|
||||||
|
if operation == '+':
|
||||||
|
result = num1 + num2
|
||||||
|
elif operation == '*':
|
||||||
|
|
||||||
|
result = num1 * num2
|
||||||
|
print(f"Результат: {result}")
|
||||||
Loading…
Reference in New Issue
Block a user