Skip to content

A simple Python-based calculator program with a user-friendly menu. Supports addition, subtraction, multiplication, and division with error handling for invalid inputs and division by zero. Ideal for beginners to learn basic programming concepts and error handling.

License

Notifications You must be signed in to change notification settings

nurulashraf/python-simple-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Simple Calculator

A simple Python-based calculator program with a user-friendly menu. This program supports basic arithmetic operations such as addition, subtraction, multiplication, and division. It includes error handling for invalid inputs and division by zero, making it a great tool for beginners to learn Python basics.

Features

  • Addition, Subtraction, Multiplication, and Division operations.
  • User-friendly menu-driven interface.
  • Error handling for:
    • Non-numeric inputs.
    • Division by zero.
    • Invalid menu choices.
  • Easy-to-understand code with comments.

Requirements

  • Python 3.x (Tested on Python 3.8 and above)

How to Use

  1. Clone this repository:

    git clone https://github.com/nurulashraf/python-simple-calculator.git
  2. Navigate to the project directory:

    cd python-simple-calculator
  3. Run the program:

    python src/calculator.py
  4. Follow the on-screen instructions to perform calculations.

Example Usage

Select an operation:
1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Exit

Enter your choice (1-5): 1
Enter the first number: 5
Enter the second number: 3
The result is: 8.0

Repository Structure

python-simple-calculator/
├── README.md          # Project description and instructions
├── src/               # Source code folder
│   └── calculator.py  # Main calculator script
└── requirements.txt   # Dependencies

License

This project is licensed under the MIT License. You are free to use, modify, and distribute it as per the terms of the license.

About

A simple Python-based calculator program with a user-friendly menu. Supports addition, subtraction, multiplication, and division with error handling for invalid inputs and division by zero. Ideal for beginners to learn basic programming concepts and error handling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages