Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Commit 697fb0c

Browse files
author
PyBash
committed
Fix vars
1 parent 1c32f0e commit 697fb0c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py_everything/maths.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ def mod(num1: Union[int, float], num2: Union[int, float]) -> Union[int, float]:
6363
return remain
6464

6565

66-
def evalExp(exp: str, vars: Dict[str, int] = {}):
66+
def evalExp(exp: str, vars_: Dict[str, int] = {}):
6767
"""Evaluates given mathematical expression"""
68-
solution: Union[int, float] = Parser.parse(exp).evaluate(vars)
68+
parser = Parser()
69+
solution: Union[int, float] = parser.parse(exp).evaluate(vars_)
6970
return solution
7071

7172
def avg(listOfNos: Union[List[int], List[float]]) -> float:

0 commit comments

Comments
 (0)