A basic Python script that takes two numbers and a mathematical operator as input, then displays the operation and the result. Perfect for quick calculations! ✨
✅ Addition (+
)
✅ Subtraction (-
)
✅ Multiplication (*
)
✅ Division (/
)
✅ Error handling for division by zero
✅ Clear output showing the operation and result
✅ Works with integers and floating-point numbers
- Run the script in a Python environment:
python calculator.py
- Enter the first number when prompted.
- Enter the second number when prompted.
- Enter the operator (
+
,-
,*
,/
). - See the operation and result displayed instantly!
Enter first number: 10
Enter second number: 5
Enter operator (addition, subtraction, multiplication, or division): *
Your Operation: 10.0 * 5.0
The Final Result: 50.0
- Python 3.x
- Inputs are converted to
float
, so both integers and decimals work. - Division by zero is handled with a friendly error message.
- Invalid operators will return an error.
This project is open-source and free to use. Enjoy! 😊