Basic-Python-Programs
Basic-Python-Programs copied to clipboard
Add improved stack based GUI calculator consisting of powers, root and reciprocations
Add Stack-Based GUI Calculator with Powers, Roots, and Reciprocations
What it does:
- This PR adds a GUI-based calculator using TKinter with the following features:
- Stack-based evaluation using infix to postfix conversion (no eval() used).
- Standard arithmetic operations: +, -, *, /, %, ^.
- Supports square root via a^(1/2) and reciprocal (1/x) via a^(-1).
- Handles negative numbers and parentheses correctly.
- Simple, clickable TKinter buttons for all operations, numbers, and clear (C).
Example Usage:
- 5^(-1) evaluates 1/5 = 0.20
- 16^(1/2) evaluates sqrt(16) = 4.0
- (-3+2)^2 evaluates to 1