Skip to content

Commit c1252fd

Browse files
Merge pull request #2021 from ilia-abbasi/ilia-calculator-patch-1
calculator.py minor improvement
2 parents 0a0675c + bc3fd39 commit c1252fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: calculator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def calc(term):
3737
purpose: This function is the actual calculator and the heart of the application
3838
"""
3939

40+
# This part is for reading and converting function expressions.
41+
term = term.lower()
42+
4043
# This part is for reading and converting arithmetic terms.
4144
term = term.replace(" ", "")
4245
term = term.replace("^", "**")
@@ -61,9 +64,6 @@ def calc(term):
6164
"e",
6265
]
6366

64-
# This part is for reading and converting function expressions.
65-
term = term.lower()
66-
6767
for func in functions:
6868
if func in term:
6969
withmath = "math." + func

0 commit comments

Comments
 (0)