Skip to content

Welcome to the Simple Calculator application! This intuitive calculator is built using Python's Tkinter library and offers essential arithmetic operations with a user-friendly interface.

License

Notifications You must be signed in to change notification settings

Goyam02/Simple-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🧮 Simple Calculator

Welcome to the Simple Calculator application! This intuitive calculator is built using Python's Tkinter library and offers essential arithmetic operations with a user-friendly interface.


✨ Features

  • Basic Arithmetic Operations: Effortlessly perform addition, subtraction, multiplication, and division.
  • Clear Functionality: Quickly reset the display to zero with a single click.
  • Dynamic Display: Watch the display update in real-time as you input numbers and operations.
  • Error Handling: Receive clear "Error!" messages for any invalid operations or inputs.

📋 Requirements

  • Python 3.x: Ensure you have Python installed on your system.
  • Tkinter: This library is typically included with Python installations.

🚀 Installation

  1. Clone the Repository: Download the source code to your local machine.

  2. Verify Python Installation: Make sure Python is installed by running python --version in your terminal.

  3. Run the Application: Execute the following command in your terminal:

    python calc.py

🛠️ Usage

  • Input Numbers: Click on the number buttons to enter numbers.
  • Perform Operations: Use the operator buttons (+, -, *, /) to execute calculations.
  • Calculate Result: Press the = button to evaluate the expression.
  • Clear Display: Hit the C button to reset the display to zero.

🧩 Code Overview

  • update_value(value): Updates the display with the selected button's value.
  • clear_value(): Resets the display to "0".
  • calculate_result(): Computes the expression on the display and shows the result. Displays "Error!" if the evaluation fails.

⚠️ Security Note

This application uses Python's eval() function to evaluate expressions. While convenient, eval() can execute arbitrary code, posing a security risk if the input is not controlled. For production environments, consider using a safer alternative for evaluating mathematical expressions.

🤝 Contributions

We welcome contributions to enhance the Simple Calculator application! If you have ideas for improvements or new features, feel free to contribute. Here's how you can help:

  1. Fork the Repository: Start by forking the repository to your GitHub account.

  2. Clone the Repository: Clone your forked repository to your local machine.

    git clone https://github.com/Goyam02/Simple-Calculator.git
    
  3. Create a Branch: Create a new branch for your feature or bug fix.

    git checkout -b feature-name
    
  4. Make Changes: Implement your changes or new features.

  5. Commit Changes: Commit your changes with a descriptive commit message.

    git commit -m "Add feature: description of feature"
    
  6. Push Changes: Push your changes to your forked repository.

    git push origin feature-name
    
  7. Create a Pull Request: Open a pull request to the main repository with a detailed description of your changes.

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.

🙏 Acknowledgments

  • Developed with ❤️ using Python and Tkinter.
  • Inspired by classic calculator applications.

Author

  • GOYAM JAIN

About

Welcome to the Simple Calculator application! This intuitive calculator is built using Python's Tkinter library and offers essential arithmetic operations with a user-friendly interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages