Skip to content

Changes to the calculator to make it more robust#15

Open
AntwanAbboud wants to merge 1 commit intosohailburki01:mainfrom
AntwanAbboud:FirstIssue
Open

Changes to the calculator to make it more robust#15
AntwanAbboud wants to merge 1 commit intosohailburki01:mainfrom
AntwanAbboud:FirstIssue

Conversation

@AntwanAbboud
Copy link

@AntwanAbboud AntwanAbboud commented May 21, 2025

This is my first issue so i just tried to change something in the first file i saw to improve its functionality. In this case, I made the calculator a bit more robust. Now it can actually work with int, not only float and it doesnt shut down if the incorrect value/key is entered. Furtermore i also added a way for the user to exit the program.

In more detail, the changes i did were:

  • I added a method that checked the format of calc results
  • Because of this new function, i changed the input to stay as a string instead of converting it to an int
  • I changed all returns in other metods to go through "format_result()"
  • I added a exception handler for if the input was either not a number or didnt fit with the operator dict
  • A way for the user to exit the program buy writing anything other than "y" or "n"

…st file i saw to improveits functionality. In this case, I made the calculator a bit mor robust. Now it can actually work with int, not only float and it doesnt shut down if the incorrect value/key is entered. Furtermore i also added a way for the user to exit the program
@AntwanAbboud AntwanAbboud changed the title This is my first issue so i just tried to change something in the fir… Changes to the calculator to make it more robust May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant