https://github.com/crespo/reverse-polish-notation
Simple Reverse Polish Notation calculator. It works with integer numbers only and the basic operators (+, -, *, /). The division result is the integer part of it.
https://github.com/crespo/reverse-polish-notation
calculator reverse-polish reverse-polish-notation rpn rpn-calculator
Last synced: 4 months ago
JSON representation
Simple Reverse Polish Notation calculator. It works with integer numbers only and the basic operators (+, -, *, /). The division result is the integer part of it.
- Host: GitHub
- URL: https://github.com/crespo/reverse-polish-notation
- Owner: crespo
- Created: 2024-04-24T18:52:54.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-24T19:20:16.000Z (about 1 year ago)
- Last Synced: 2025-01-13T12:18:29.491Z (6 months ago)
- Topics: calculator, reverse-polish, reverse-polish-notation, rpn, rpn-calculator
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reverse Polish Notation Calculator
Simple Reverse Polish Notation calculator. It works with integer numbers only and the basic operators (+, -, *, /). The division result is the integer part of it.## How it works:
1. Read a input.
2. If it is an integer (operand), push to the stack.
3. If it is an operator, pop the last and second-to-last operands off the stack, do the operation and then push it back to the stack.
4. If it is empty, close the program.## Usage:
1. ```git clone https://github.com/crespo/reverse-polish-notation.git```
2. ```cd ./reverse-polish-notation```
3. ```python main.py```
4. ```Type a integer number or a basic operator (+ = sum, - = subtraction, * = multiplication, / = division) and ↵ Enter.```
5. ```When you've finished, type ↵ Enter again and the program should stop.```## Example:
#### 