From 895695f5a8541dc53211229077bae3519c3a1245 Mon Sep 17 00:00:00 2001 From: BuravovA Date: Fri, 7 Nov 2025 18:32:29 +0400 Subject: [PATCH] chandeg minus func --- calc.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/calc.py b/calc.py index ed67502..e4a3b18 100644 --- a/calc.py +++ b/calc.py @@ -1,7 +1,7 @@ def main(): print("Welcome to the Calculator") command = input("Select command: [ + ] [ - ] [ * ] [ / ] \nType exit if u want exit \n") - match command: + match command: #выбор команд case "+": summ() case "*": @@ -18,7 +18,7 @@ def summ(): total = 0 while True: num_input = input() - if num_input == " ": + if num_input == " " or num_input == "": print (f"Total summ = {total}") main() try: @@ -43,7 +43,7 @@ def minus(): print("Error, enter correct number") def multiplication(): print("Enter number to multiplication, enter space to calculate") - total = 0 + total = 1 while True: num_input = input() if num_input == " ": @@ -55,5 +55,6 @@ def multiplication(): print(f"Total multiplication = {total}") except ValueError: print("Error, enter correct number") + if __name__ == "__main__": - main() + main() #запуск функции main, основа программы \ No newline at end of file