Skip to content

Repository files navigation

Python Calculator

A simple command-line calculator application written in Python that supports basic arithmetic operations.

Features

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Power (^)
  • Modulo (%)
  • Error handling for division by zero
  • User-friendly menu interface
  • Input validation

Requirements

  • Python 3.x

Installation

  1. Clone this repository:
git clone https://github.com/samsond/python-calculator.git
cd python-calculator
  1. Run the calculator:
python calculator.py

Usage

  1. Run the application
  2. Select an operation from the menu (1-6)
  3. Enter two numbers when prompted
  4. View the result
  5. Press Enter to continue or select 7 to exit

Example

========================================
       PYTHON CALCULATOR
========================================
1. Addition (+)
2. Subtraction (-)
3. Multiplication (*)
4. Division (/)
5. Power (^)
6. Modulo (%)
7. Exit
========================================

Select operation (1-7): 1

Addition selected
Enter first number: 10
Enter second number: 5

Result: 10.0 + 5.0 = 15.0

Press Enter to continue...

License

This project is open source and available under the MIT License.

About

A simple command-line calculator application written in Python

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages