Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Calculator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down