diff --git a/Calculator/main.py b/Calculator/main.py index 599cbc0..45d1b0d 100644 --- a/Calculator/main.py +++ b/Calculator/main.py @@ -53,10 +53,14 @@ def calculator(): print(f"{num2} {operation_symbol} {num1} = {answer}") else: print(f"{num1} {operation_symbol} {num2} = {answer}") + + end=input(f"Type 'y' to continue calculating with {answer}, or type 'n' to start a new calculation or type 'exit' to end calculation : ") + - if input(f"Type 'y' to continue calculating with {answer},\ - or type 'n' to start a new calculation: ") == "y": + if end == "y": num1 = answer + elif end.lower()== "exit": + break else: should_continue = False calculator()