Scripts made with python. It allows you to interpret RPN operations and find the result.
Clone the project :
git clone https://github.com/zakt67/ReversePolishNotation.git
Go to the project directory :
cd ./RPN-model-calculator
Create a new python file and import rpn.py file :
from rpn import *
Call the funcitons as needed :
# Digits only usage
digits_calculation("your operation goes here")
# Basic numbers usage
numbers_calculation("your operation goes here")
# Floats support usage
float_calculation("your operation goes here")
Format exemple :
numbers_calculation("1245-*+") # It calculate : 1 + 2 * (4 - 5)
Add assertion tests (Optionnal) :
# Digits
assert digits_calculation("132-+") == 2
# Numbers
assert numbers_calculation("(120)(10)*") == 1200
# Floats
assert float_calculation("(2.4)8/") == 0.3