| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Disclaimer: This README file was written by AI that is implemented in this project.
This app is a simple calculator that can evaluate infix expressions with basic arithmetic operators (+, -, *, /). It also renders the expression and result in a box.
To run the calculator, create a python script that uses the calculator and render functions. For example:
from pkg.calculator import Calculator
from pkg.render import render
calculator = Calculator()
expression = "1 + 2 * 3"
result = calculator.evaluate(expression)
if result is not None:
print(render(expression, result))
else:
print("Invalid expression")Save this file as main.py and run it from the command line using python main.py.
The calculator evaluates expressions based on operator precedence (* and / have higher precedence than + and -).
| Back | FazBrowse Home | New Git URL |