This is a simple graphical user interface (GUI) calculator created using Python and the Tkinter library. It allows you to perform basic mathematical operations and additional operations like factorial and exponentiation.
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exponentiation (^)
- Factorial (!)
- Clear (C)
- Error handling for invalid expressions
- Python 3.x
- Tkinter (usually included with Python)
- Clone this repository:
git clone https://github.com/yourusername/simple-calculator.git
cd simple-calculator
- Run the Python script: bash
python main.py The calculator GUI will open, allowing you to perform calculations.
- Click the numeric buttons to enter numbers.
- Click the operation buttons (+, -, *, /, ^, !) to perform calculations.
- Click the "=" button to display the result.
- Click the "C" button to clear the display.
- Invalid expressions will result in an "Error" message.
Example
- Click "5"
- Click "!"
- Click "="
- The result should be displayed as "120."
- Click "2"
- Click "^"
- Click "3"
- Click "="
- The result should be displayed as "8."
This project is licensed under the MIT License. See the LICENSE file for details.
This project was created as a simple example of building a GUI calculator with Python and Tkinter. Feel free to modify and improve this calculator or use it as a reference for your own projects. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.
In this README, you can provide a brief description of the project, list its features, o