WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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