This is a basic command-line calculator that performs arithmetic operations. It allows the user to perform multiple calculations consecutively, with options for addition, subtraction, multiplication, and division.
Addition, Subtraction, Multiplication, and Division: Select the type of operation to perform. Input Validation: Ensures that inputs are valid numbers. Division by Zero Handling: Safely handles division by zero with an error message. Repeat Calculations: After each calculation, you can choose to perform another calculation or exit.
you need to have Python installed on your machine. You can download it Python
Simple Calculator Select operation:
- Addition
- Subtraction
- Multiplication
- Division
Enter the number of the operation (1/2/3/4): 1 Enter the first number: 10 Enter the second number: 5 The result is: 15.0 Do you want to perform another calculation? (yes/no): yes
Select operation:
- Addition
- Subtraction
- Multiplication
- Division
Enter the number of the operation (1/2/3/4): 4 Enter the first number: 10 Enter the second number: 0 The result is: Error! Division by zero. Do you want to perform another calculation? (yes/no): no Thank you for using the calculator. Goodbye!