https://github.com/gil9red/calc-parser-python
Математический парсер простых выражений (#python #python3 #calc #parser)
https://github.com/gil9red/calc-parser-python
Last synced: 8 months ago
JSON representation
Математический парсер простых выражений (#python #python3 #calc #parser)
- Host: GitHub
- URL: https://github.com/gil9red/calc-parser-python
- Owner: gil9red
- Created: 2015-02-24T17:06:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-01T21:48:23.000Z (about 11 years ago)
- Last Synced: 2025-02-08T22:26:32.449Z (over 1 year ago)
- Language: Python
- Size: 230 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# calc-parser-python
Математический парсер простых выражений (#python #python3 #calc #parser)
##### Пример:
###### >>> from calc_parser import Parser
###### >>> Parser("10 + 2.4 * 3.1456 - 2").calc()
###### 15.54944
###### >>> Parser("1 + 2 * 2 + 2").calc()
###### 7
###### >>> Parser("3 + (-1 - 1)").calc()
###### 1
###### >>> Parser("3 + (-1 + (2 * 3 - 1) - 1)").calc()
###### 6
###### >>> Parser("2 ^ 3 + 2 + 3 ^ 2 + 1").calc()
###### 20