https://github.com/wojtekb30/odwrotna-notacja-polska-reverse-polish-notation-python
Odwrotna Notacja Polska - moja implementacja Python. Reverse Polish Notation - my Python implementation.
https://github.com/wojtekb30/odwrotna-notacja-polska-reverse-polish-notation-python
math python3 reversepolishnotation
Last synced: about 1 month ago
JSON representation
Odwrotna Notacja Polska - moja implementacja Python. Reverse Polish Notation - my Python implementation.
- Host: GitHub
- URL: https://github.com/wojtekb30/odwrotna-notacja-polska-reverse-polish-notation-python
- Owner: Wojtekb30
- License: mit
- Created: 2022-12-09T21:12:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-13T09:51:19.000Z (over 2 years ago)
- Last Synced: 2025-02-04T09:17:07.919Z (3 months ago)
- Topics: math, python3, reversepolishnotation
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Odwortna Notacja Polska
Moja implementacja liczenia działań w Odwrotej Notacji Polskiej w Python.
Jak działa:
Wpisane działanie zostaje przekonwertowane na tabelę.
Program skanuje ją od lewej do prawej aż znajdzie znak wskazujący na obliczenie (+, -, *, /). Wykonuje je, zapisuje liczbę wynikową, czyści resztę wykonanego działania i przesuwa wszystkie elementy tabeli do lewej. Jest to zapętlane aż w tabeli zostanie tylko jedna liczba będąca wynikiem.
# Reverse Polish Notation
My implementation of calculating Reverse Polish Notation in Python.
How it works:
The typed calculation is converted into a table.
The program scans it from left to right until it finds a character indicating a operation (+, -, *, /). It performs it, stores the resulting number, clears the other elements of the just done calculation and moves all the elements of the table to the left. This is looped until there is only one number (which is the result) left in the table.