From e195a264e6ca9f5d1857deeafea02ac24027cd75 Mon Sep 17 00:00:00 2001 From: BalkinaD Date: Thu, 27 Nov 2025 09:18:15 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ffggf.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ffggf.py diff --git a/ffggf.py b/ffggf.py new file mode 100644 index 0000000..2ee56de --- /dev/null +++ b/ffggf.py @@ -0,0 +1,29 @@ +def calculator(): + print("Выберите операцию:") + print("1. Сложение") + print("2. Умножение") + print("3. Вычитание") + print("4. Деление") + choice = input("Введите номер операции (1/2/3/4): ") + + if choice in ['1', '2','3','4']: + num1 = float(input("Введите первое число: ")) + num2 = float(input("Введите второе число: ")) + + if choice == '1': + result = num1 + num2 + operation = "Сложение" + if choice == '2': + result = num1 * num2 + operation = "Умножение" + if choice == '3': + result = num1 - num2 + operation = "Вычитание" + if choice == '4': + result = num1 / num2 + operation = "Деление" + print(f"Результат {operation}: {result}") + else: + print("Некорректный ввод.") + +calculator() \ No newline at end of file