Skip to content

tomas-ramoska/cli_python_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple CLI Calculator 🔢

This repository contains a simple command-line interface (CLI) calculator implemented in Python. The calculator supports basic arithmetic operations such as addition, subtraction, multiplication, and division.

Features:

  • Addition: Adds two numbers.
  • Subtraction: Subtracts the second number from the first.
  • Multiplication: Multiplies two numbers.
  • Division: Divides the first number by the second, with error handling for division by zero.

Usage:

  1. Clone the repository:

    git clone https://github.com/CodeByTomas/simple_cli_calculator.git
    cd simple_cli_calculator
  2. Run the calculator with uv:

    uv run cli_python_calculator.py
  3. Follow the on-screen prompts to select an operation and input numbers.

Example:

Simple CLI Calculator by @CodeByTomas
Select operation:
1. Add
2. Subtract
3. Multiply
4. Divide
Enter choice(1/2/3/4): 1
Enter first number: 5
Enter second number: 3
Result: 8.0

Functions:

  • add(x, y): Returns the sum of x and y.
  • subtract(x, y): Returns the difference of x and y.
  • multiply(x, y): Returns the product of x and y.
  • divide(x, y): Returns the quotient of x and y. If y is 0, returns an error message.

License:

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages