diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Main.py b/Main.py index c0521db..bf12b08 100644 --- a/Main.py +++ b/Main.py @@ -8,23 +8,28 @@ # main program running the calculator def main(): while True: - + # run the input functions calc_first_number = calc_first_number_input() calc_operator = calc_operator_input() calc_second_number = None + # only run second number input if user doesn't want to have the square root of first number if calc_operator != "*/": calc_second_number = calc_second_number_input() + # calculate the inputs calc_result = calc_calculation(calc_first_number, calc_operator, calc_second_number) + # check if calculation result is a whole number if calc_result.is_integer(): print(f"The result is: {int(calc_result)}") else: print(f"The result is: {calc_result}") + # run calculator restart function calc_restarter = calc_restart() + # check status of calculator restart function if calc_restarter: continue else: diff --git a/__pycache__/CalcOperator.cpython-310.pyc b/__pycache__/CalcOperator.cpython-310.pyc index 1e264d6..0e2dc7e 100644 Binary files a/__pycache__/CalcOperator.cpython-310.pyc and b/__pycache__/CalcOperator.cpython-310.pyc differ