Ilshat-Akhmetov / Arithmetic-Parser

An example how an arithmetic parser can be implemented in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arithmetic-Parser

An example of parsing and solving an arithmetic expression.

Supports +, -, *, / and () operators.

Made for educational purposes

To try it run * main.py *

Examples

1.

input: 12 + 3

output: 15.0

2.

input: ((12+7)*12-7)/12

output: 18.416666666666668

3.

input: (12 - 3

output: The bracket with index 0 does not have enclosing pair

About

An example how an arithmetic parser can be implemented in python


Languages

Language:Python 100.0%