Skip to content

BaseMax/PythonExpressionInterpreter

Repository files navigation

Python Expression Interpreter

Simple Math Interpreter in Python

Using

python main.py

Example

calc > 5
5.0
calc > -110
-110.0
calc > --110
110.0
calc > ---110
-110.0
calc > 5*4+5
25.0
calc > 5/2+4*4+(5/4-2)+1/1
18.75

Unit Testing

python -m unittest lexer_test
python -m unittest parser_test
python -m unittest interpreter_test 

References