Обновить calcul.py

This commit is contained in:
PonomarevaY 2025-11-27 09:31:59 +00:00
parent fb7d181e2e
commit 4770463f8e
2 changed files with 9 additions and 10 deletions

View File

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

9
calcul.py Normal file
View File

@ -0,0 +1,9 @@
def calculator():
operation=input("+,*,-,/")
number1=float(input("1 число: "))
number2=float(input("2 число: "))
if operation=='+':
result=number1+ number2
elif operation=='*':
result=number1*number2
print(f"Результат: {result}")