A feature-rich command-line calculator built in Python that handles all standard arithmetic operations, maintains a session history, and manages all edge cases gracefully without crashing.
- Addition, subtraction, multiplication, division
- Exponentiation and modulo operations
- Square root operations
- Full input validation — handles letters, empty input, division by zero
- Session history — view every calculation performed
- Clear history command
- Save History to file feature
- Clean, intuitive menu-driven interface
- Continuous session loop — calculate as many times as you want
- Python 3.8 or higher
git clone https://github.com/ERYXGF/smart_calculator_python.git cd smart-calculator python main.py
No external dependencies — standard library only.
Run the program and select an operation from the menu by entering its number. Enter your two values when prompted. After each result you can continue calculating, view, clear or save your history, and quit.
- Python 3.11
- Standard library only (math module)
- Structuring a project across multiple files with clean imports
- Robust input validation using try/except blocks
- Managing application state (history) using lists
- Building intuitive menu-driven CLI applications
- Break down a bigger project into smaller subsections
- "Link" many smaller functions into one "directorial" function
- Name git commits appropriately
- Handling arithmetic edge cases like division by zero
- Chain calculations using the previous result
- Logarithm operations
- GUI version using tkinter
- Integrate colours and a cleaner display in the terminal
MIT Licence — see LICENSE for details.
Project 1 of 12 — Python learning roadmap