This is a basic command-line calculator program written in Python. It allows users to input two numbers and perform one of four mathematical operations: addition, subtraction, multiplication, or division. The result of the operation is displayed to the user.
Accepts two numerical inputs from the user.
Supports the following operations:
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Displays the result in a clear and user-friendly format.
Python 3.x
Clone or download this repository to your local machine.
Open a terminal or command prompt.
Navigate to the directory containing the program file.
Run the program using Python:
bash python calculator.py Follow the prompts to:
Enter the first number.
Enter the second number.
Choose an operation (+, -, *, or /).
Example bash Enter the first number: 10 Enter the second number: 5 Enter the operation (+, -, *, /): + 10 + 5 = 15
If division by zero is attempted, the program will display an error message: "Error: Division by zero is not allowed!"
If an invalid operation is entered, the program will display: *"Invalid operation. Please use one of +, -, , or /."
Customization Feel free to modify the program to include additional features, such as:
Support for more operations (e.g., exponentiation, modulus).
Input validation to handle non-numeric inputs gracefully.