Skip to content

olegbrok/calculator-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Calculator CLI

A simple Python CLI calculator that takes two numbers and an operator as arguments.

Usage

python3 calc.py <number> <operator> <number>

Operators

  • + - Addition
  • - - Subtraction
  • * - Multiplication
  • / - Division

Examples

python3 calc.py 10 + 5      # Output: 15
python3 calc.py 10 - 3      # Output: 7
python3 calc.py 6 * 7       # Output: 42
python3 calc.py 15 / 4      # Output: 3.75

Error Handling

The calculator gracefully handles:

  • Invalid numbers
  • Unknown operators
  • Division by zero
  • Missing arguments

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages