Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 799 Bytes

File metadata and controls

14 lines (12 loc) · 799 Bytes

A smart and robust Command Line Interface (CLI) calculator built with Python.

Features

  • Continuous Operation: Runs inside a while True loop until you type exit.
  • Supported Operations: Addition (+), subtraction (-), multiplication (*), division (/), modulo (%), and exponentiation (**).
  • Crash Prevention (Input Guard): Uses try-except blocks to smoothly handle invalid inputs like letters.
  • Zero Division Protection: Prevents the application from crashing when attempting to divide by zero.
  • Overflow Prevention: Limits the power operation (**) to exponents under 500 to stay within Python's integer string conversion limits.

How to Run

Make sure you have Python installed, then run the script in your terminal:

python calculator.py