A beginner-friendly command-line calculator application built using Python.
This program performs basic arithmetic operations and runs continuously until the user exits.
This project is created to practice Python basics such as input handling, conditional statements, loops, and error handling.
The calculator allows users to perform operations multiple times in a single run.
- Practice Python syntax and logic building
- Understand loops and conditional statements
- Handle user input and errors gracefully
- Build a simple interactive CLI application
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Handles division by zero
- Handles invalid number input
- Continuous execution until user types
exit
Python input/output While loops Conditional statements Exception handling (try-except) Writing clean and readable code
- Make sure Python is installed on your system
- Save the file as
calculator.py - Open terminal or command prompt
- Run the command:
python calculator.py
User enters two numbers User selects an operation (+, -, *, /) Result is displayed Program repeats until the user types exit
Simple Calculator App Type 'exit' anytime to quit.
Enter first number: 10 Enter second number: 5 Enter operation (+, -, *, /): * Result: 10.0 * 5.0 = 50.0
Enter first number: exit Exiting calculator... Goodbye!
👨💻 Author
Aakash Gupta 🕹 Beginner Python Developer 📧 Feel free to connect or share feedback!