Skip to content

Commit

Permalink
Merge pull request #2021 from ilia-abbasi/ilia-calculator-patch-1
Browse files Browse the repository at this point in the history
calculator.py minor improvement
  • Loading branch information
geekcomputers authored Oct 26, 2023
2 parents 0a0675c + bc3fd39 commit c1252fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("^", "**")
Expand All @@ -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
Expand Down

0 comments on commit c1252fd

Please sign in to comment.