-
Notifications
You must be signed in to change notification settings - Fork 0
kasey-okm/basic-calculator
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
# Basic Calculator A simple Python command-line calculator that performs addition, subtraction, multiplication, and division based on user input. ## How to Use 1. **Open Terminal** Open your terminal in the folder containing `cal.py`. 2. **Run the Program** Run the following command: ``` python cal.py ``` 3. **Follow Prompts** - Enter the first number when prompted. - Enter the second number. - Enter the operation (`+`, `-`, `*`, or `/`). 4. **View Result** The program will display the result of the calculation. ## Example ``` Enter the first number: 10 Enter the second number: 5 Enter an operation (+, -, *, /): + 10.0 + 5.0 = 15.0 ``` ## Error Handling - If you enter a non-numeric value, you'll see: `Invalid input. Please enter numeric values.` - If you try to divide by zero, you'll see: `Error: Division by zero is not allowed.` - If you enter an invalid operation, you'll see: `Invalid operation. Please use +, -, *, or /.` --- Simple and easy to use!
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published