A simple Python calculator that performs basic arithmetic operations (addition, subtraction, multiplication, and division) on two user-input numbers.
- Takes two numbers as input
- Supports four operations:
+,-,*,/ - Handles division by zero error
- Provides clear output showing the operation and result
- User-friendly prompts
- Python 3.x
No installation required. Just run the Python script directly.
- Run the program:
python calculator.py
- Follow the on-screen prompts:
- Enter the first number
- Enter the second number
- Choose an operation (+, -, *, /)
$ python calculator.py
Enter the first number: 10
Enter the second number: 5
Enter the operation (+, -, *, /): +
10.0 + 5.0 = 15.0- Displays error for invalid operations (anything other than +, -, *, /)
- Prevents division by zero with appropriate error message
This project is open source and free to use.
Contributions are welcome! Please fork the repository and submit a pull request.
For questions or feedback, please open an issue in the repository.