This is a simple Command-Line Calculator built using Python. It allows users to perform basic arithmetic operations such as addition, subtraction, multiplication, and division. The program uses functions for each operation and continuously runs in a loop until the user chooses to exit.
Menu-driven interface
Supports basic operations: +, -, *, /
Handles invalid inputs and division by zero
Loops until user exits
Python (Programming Language)
VS Code
Terminal
Save the file as CLI_calculator.py.
Open the terminal and navigate to the file location.
Run the program using:
python CLI_calculator.py
Follow the menu to perform calculations.
Defined functions for each operation (add, subtract, multiply, divide).
Used input() to take numbers and operation choices from the user.
Used a while loop to repeatedly show the menu until the user chooses Exit (5).
Added error handling for invalid inputs and division by zero.