Skip to content

Commit 0b4e18e

Browse files
committed
Add term.lower
1 parent b337c6a commit 0b4e18e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

calculator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ def calc(term):
4444
functions = ['sin', 'cos', 'tan', 'cosh', 'sinh', 'tanh', 'sqrt', 'pi', 'radians', 'e']
4545

4646
# This part is for reading and converting function expressions.
47+
term = term.lower()
48+
4749
for function in functions:
48-
if function in term.lower():
50+
if function in term:
4951
withmath = 'math.' + function
5052
term = term.replace(function, withmath)
5153

0 commit comments

Comments
 (0)