The purpose of this academic project was to simulate (using Python) how various computer languages computes arithmetic expressions and functions (ex: var= z + 3 * factorial (7)).
If you are interested to see what this project does, clone this repository. Then run evaluate.py. In the IDLE, you can use the following commands:
- evaluate an expression by: evaluate("1+2 -3*4/ 2")
- evaluate an expression and store it in variable: evaluate("var3 = 2+ 4-1*2")
- reuse stored variable: evaluate("var3 * 4")
- Evalute conditionals and booleans: evaluate("var3>1 and 4>1 ? a = 4 : b = 1")
- Define functions: evaluate("deffn abs(x) = x > 0 ? x : 0-x")
- Use functions once defined: evaluate("abs(21-22)")