diff --git a/calculator.py b/calculator.py index b12986aa7e6..b0ef5dca8dd 100644 --- a/calculator.py +++ b/calculator.py @@ -37,6 +37,9 @@ def calc(term): purpose: This function is the actual calculator and the heart of the application """ + # This part is for reading and converting function expressions. + term = term.lower() + # This part is for reading and converting arithmetic terms. term = term.replace(" ", "") term = term.replace("^", "**") @@ -61,9 +64,6 @@ def calc(term): "e", ] - # This part is for reading and converting function expressions. - term = term.lower() - for func in functions: if func in term: withmath = "math." + func