Skip to content

Dharani04122005/Python-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

CLI_Calculator

πŸ“˜ Overview

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.


βš™οΈ Features

Menu-driven interface

Supports basic operations: +, -, *, /

Handles invalid inputs and division by zero

Loops until user exits


🧰 Tools Used

Python (Programming Language)

VS Code

Terminal


πŸ§‘β€πŸ’» How to Run

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.


πŸ“„ Code Explanation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages