An open API service indexing awesome lists of open source software.

https://github.com/nurulashraf/python-simple-calculator

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.
https://github.com/nurulashraf/python-simple-calculator

calculator error-handling learning-python open-source python python-basics simple-project

Last synced: 10 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# 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:
```bash
git clone https://github.com/nurulashraf/python-simple-calculator.git
```
2. Navigate to the project directory:
```bash
cd python-simple-calculator
```
3. Run the program:
```bash
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](LICENSE). You are free to use, modify, and distribute it as per the terms of the license.