Skip to content

Aniket-Gupta-Tech-2005-31/Simple-Calculator-Using-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

simple calculator using python

Overview

This project implements a simple calculator using Python's turtle graphics library. The calculator allows users to perform basic arithmetic operations including addition, subtraction, multiplication, and division. The results are displayed using the turtle graphics interface.

Features

  • Input two numbers via dialog boxes.
  • Choose an arithmetic operation (Addition, Subtraction, Multiplication, Division).
  • Display the result on the turtle graphics screen.
  • Handle division by zero gracefully with an error message.

Installation

To run this project, you need to have Python installed on your system. The turtle module is included with the standard Python library, so no additional installation is required.

Usage

  1. Clone the Repository:

    git clone https://github.com/Aniket-Gupta-Tech-2005/Simple-Calculator-Using-python.git
    cd simple-calculator
  2. Run the Program:

    python calculator.py
  3. Follow the Prompts:

    • Enter two numbers when prompted.
    • Select the operation you wish to perform by entering the corresponding number or symbol.
    • The result will be displayed on the turtle graphics window.

Code Explanation

  • calculate(): Function to perform the calculation based on user input and display the result using turtle graphics.
  • turtle.setup(): Configures the turtle graphics window.
  • turtle.numinput(): Prompts the user to enter numbers.
  • turtle.textinput(): Prompts the user to choose an operation.
  • turtle.write(): Displays the result on the screen.

Video

Watch the video

Contributing

Feel free to open issues or submit pull requests if you have suggestions or improvements.

About

CODTECH PYTHON PROGRAMING TASK1 (simple calculator)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages