๐งฎ CLI Calculator
A simple and robust command-line calculator built using Python.
This project was created as part of a project-based learning journey, focusing on problem-solving, clean logic design, and real-world coding practices.
Project Repository: CLI Calculator on GitHub
๐ Problem Statement
Build a command-line application that:
- Runs continuously in the terminal
- Allows the user to select an arithmetic operation
- Accepts two numeric inputs (integers or floats)
- Displays the calculated result
- Handles invalid input safely
- Exits only when the user chooses the Exit option
๐ฏ Objectives
- Practice Python fundamentals through a real project
- Design program logic before writing code
- Handle user input and errors safely
- Separate program control flow from business logic
- Build confidence by completing a fully working application
โ๏ธ Features
- Menu-driven command-line interface
- Supports addition, subtraction, multiplication, and division
- Accepts integers and floating-point numbers
- Handles invalid menu selections gracefully
- Prevents crashes due to invalid numeric input
- Handles division by zero safely
- Continuous execution until user exits
- Clean and modular code structure
๐ง Program Logic
- Display a menu of available operations
- Ask the user to select an operation
- Exit the program if the user selects Exit
- Validate the userโs menu choice
- Prompt the user to enter two numbers
- Perform the selected arithmetic operation
- Display the result
- Repeat the process until Exit is chosen
๐ Project Structure
```text
cli-calculator/
โ
โโโ main.py # Handles user interaction and program flow
โโโ calculator.py # Contains arithmetic logic functions
โโโ README.md # Project documentation