A simple and user-friendly command-line calculator built using Python.
This project demonstrates basic programming concepts including functions, loops, error handling, input validation, and data storage with calculation history tracking.
- Perform addition ➕, subtraction ➖, multiplication ✖️, and division ➗ with zero-check handling
- Interactive menu-driven interface with clear prompts and informative messages
- Prevents crashes by validating user input and handling invalid data gracefully
- Keeps a session-long history of all calculations, accessible anytime
- Option to quit anytime with a polite goodbye message
- Python 3.x installed on your system
- No additional libraries required
- Clone this repository or download the source code
- Open your terminal or command prompt
- Navigate to the project directory
- Run the calculator script with:
Calculator_project.py
🙏Welcome to the world best precise calculator_ 1.Addition (➕) 2.Subtraction(➖) 3.Multipication( ✖️ ) 4.Division(➗)
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:+ Enter 1st number:10 Enter 2nd number:90 10.0 + 90.0 = 100.0
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:- Enter 1st number:100 Enter 2nd number:50 100.0 - 50.0 = 50.0
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:* Enter 1st number:20 Enter 2nd number:25 20.0 * 25.0 = 500.0
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:h 🤔 History of your calculation 1➡️ You did this --> 10.0 + 90.0 = 100.00 2➡️ You did this --> 100.0 - 50.0 = 50.00 3➡️ You did this --> 20.0 * 25.0 = 500.00
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:yes ❌Invalid choice. Please choose correct choice
Enter your choice (➕ ➖ ✖️ ➗(/)), h for history or q for quit:q Thanks for using our calculator 👋Good bye! see youe again💞
- Add scientific functions (trigonometry, logarithms)
- Save and load calculation history to a file
- Support input of complex expressions
- Develop a graphical user interface (GUI)
Birendra Paul is a passionate data science student with a keen interest in Python programming and machine learning.
Dedicated to continuous learning, Birendra enjoys building projects that enhance practical skills and help support educational goals.
Connect with Birendra on:
Feel free to reach out for collaboration, feedback, or mentorship!