From a1f1bb32c44d0b23b7f2c1f6e014f3a9dfbcff95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:42:58 +0000 Subject: [PATCH 1/2] Bump openpyxl from 3.1.2 to 3.1.5 Bumps [openpyxl](https://openpyxl.readthedocs.io) from 3.1.2 to 3.1.5. --- updated-dependencies: - dependency-name: openpyxl dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements_with_versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_with_versions.txt b/requirements_with_versions.txt index bab7905dee8..863a0f9779b 100644 --- a/requirements_with_versions.txt +++ b/requirements_with_versions.txt @@ -52,7 +52,7 @@ patterns==0.3 openai==1.33.0 background==0.2.1 pydantic==2.7.3 -openpyxl==3.1.2 +openpyxl==3.1.5 pytesseract==0.3.10 requests-mock==1.12.1 pyglet==2.0.10 From 97e879191e06fa642ced5b818dea2c407a65d915 Mon Sep 17 00:00:00 2001 From: xavierfingers Date: Sat, 1 Nov 2025 15:35:15 -0600 Subject: [PATCH 2/2] Fixed stuff. --- calculator.py | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/calculator.py b/calculator.py index ff456112afa..6a8e823df59 100644 --- a/calculator.py +++ b/calculator.py @@ -27,9 +27,6 @@ ## Imported math library to run sin(), cos(), tan() and other such functions in the calculator -from fileinfo import raw_input - - def calc(term): """ input: term of type str @@ -76,18 +73,14 @@ def calc(term): # here goes to the error cases. except ZeroDivisionError: print("Can't divide by 0. Please try again.") - except NameError: print("Invalid input. Please try again") - except AttributeError: print("Please check usage method and try again.") except TypeError: - print("please enter inputs of correct datatype ") - + print ("Please only enter integers") return term - def result(term): """ input: term of type str @@ -109,21 +102,12 @@ def main(): "\nScientific Calculator\n\nFor Example: sin(rad(90)) + 50% * (sqrt(16)) + round(1.42^2)" + "- 12mod3\n\nEnter quit to exit" ) - - if sys.version_info.major >= 3: - while True: - k = input("\nWhat is ") - if k == "quit": - break - result(k) - - else: - while True: - k = raw_input("\nWhat is ") - if k == "quit": - break - result(k) - - -if __name__ == "__main__": +k = input("\nWhat is ") +if k == "quit" or "q": + result(k) +elif k == None: + print("Couldn't read input. Please try again.") +elif q == None: + print("Couldn't read input. Please try again.") +else: main()