Skip to main content

Simple Calculator Using Python

    

 Simple Calculator Using Python

    

Hello friends in this blog we will learn how we can create simple calculator using python.

To create calculator we required Tkinter library which is built-in library of python. With the help of this library we can create GUI of the application. 

To create calculator we follow some steps:-

1) Import all required libraries and create the basic window:-


2) Add required widgets to window:- In this step add number and operators buttons to the window.


3) Create function for each button:- In this step create separate functions for 0 to 9 numbers, operator (+,-,*,/), equals, clear buttons.

    i] Function for 0 to 9 numbers:- Here we create one function for 0 to 9 numbers. We pass number as a parameter to function so that one function is enough for 0 to 9 number buttons.

    ii] Function for operators(+,*,-,\):- Here we create separate functions for each operator. 

            



   
    iii] Function for equal button:- In this function actual calculation will perform.


Output:-


To know more about this project please watch this project video.

Comments

Contact Form

Name

Email *

Message *

Popular posts from this blog

Mail Sending Using Tkinter

 Mail Sending Using Tkinter In this Blog We will learn how to send email through tkinter. Tkinter provides GUI toolkit. With the help of this we can create so many GUI applications.  In this blog we create the mail sending application using tkinter. Steps of the project: 1. Import required packages and library 2. Create basic GUI 3. Add required widgets to GUI. 4. Create a function for mail sending. 1. Import required packages and library: 2. Create basic GUI: 3.  Add required widgets to GUI.: 4. Create a function for mail sending. Output: smtplib: smtplib is the python built in library for sending and receiving the mail. SMTP stands for Simple Mail Transfer Protocol.  smtplib.SMTP(domain,port):  In this method add domain which you want for example gmail.com. SMTP has three ports which are 25, 465 and 587 by using this three ports we can send the mail.  smtplib.login(userid,password): This method logins to your account.And send mail from this email id....