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.
- Host: GitHub
- URL: https://github.com/nurulashraf/python-simple-calculator
- Owner: nurulashraf
- License: mit
- Created: 2025-01-26T07:45:47.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-03T07:32:48.000Z (12 months ago)
- Last Synced: 2025-02-12T09:54:53.272Z (11 months ago)
- Topics: calculator, error-handling, learning-python, open-source, python, python-basics, simple-project
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.