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.
- 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.
- Python 3.x (Tested on Python 3.8 and above)
-
Clone this repository:
git clone https://github.com/nurulashraf/python-simple-calculator.git
-
Navigate to the project directory:
cd python-simple-calculator
-
Run the program:
python src/calculator.py
-
Follow the on-screen instructions to perform calculations.
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
python-simple-calculator/
├── README.md # Project description and instructions
├── src/ # Source code folder
│ └── calculator.py # Main calculator script
└── requirements.txt # Dependencies
This project is licensed under the MIT License. You are free to use, modify, and distribute it as per the terms of the license.