A beginner-friendly Python calculator project that performs basic arithmetic operations and stores calculation history in a file.
This project is a simple command-line calculator built using Python.
It allows users to perform basic mathematical operations such as addition,
subtraction, multiplication, and division.
It also includes a history feature that saves all calculations in a text file
and allows users to view or clear the history anytime.
- โ Addition
- โ Subtraction
- โ๏ธ Multiplication (supports * and x)
- โ Division with zero-division handling
- ๐ View calculation history
- ๐๏ธ Clear calculation history
- โจ๏ธ Shortcut commands for fast usage
- Python
- File Handling
- OS Module
- Command Line Interface (CLI)
Simple-Calculator/ โ โโโ main.py โโโ History.txt โโโ README.md
- Make sure Python is installed on your system
- Clone this repository
- Open terminal in project folder
- Run the command :
python main.py
| Command | Action |
|---|---|
| ? | Show calculation history |
| - | Clear history |
| q | Exit program |
Enter calculation or command: 10+5 Result: 15Enter calculation or command: ? 10+5=15
Enter calculation or command: - Your history has been cleared.
- Understanding Python functions
- File handling (read, write, append)
- Error handling using try-except
- Basic input validation
- Building CLI-based projects
Aditya Tiwari
MCA Student
Passionate about learning programming and building real-world projects.
If you like this project, feel free to โญ star the repository and share your feedback.