Nanasaheb Mahadik Polytechnic Institute, Peth
Tal – Walwa , Dist - Sangli 415407
Year 2023-24
A
Micro-Project Report on
“CALCULATER SYSTEM USING PYTHON”
Submitted in partial fulfillment of the requirements for
Diploma in Computer Engineering
of
M.S.B.T.E., MUMBAI
By
Sr. No. First Name Middle Name Last Name Roll no.
1. Anushka Hanmant Gaikwad 32
2. Shruti Prakash Sathe 35
3. Snehal Uttam Jadhav 06
4. Shreya Anil Sutar 37
5. Janhvi Jaywant Shinde 38
UNDER THE GUIDANCE OF
Ms. [Link]
Shri Venkateshwara Shikshan Sanstha’s
Nanasaheb Mahadik Polytechnic Institute, Peth
Tal - Walwa, Dist - Sangli 415407
Year 2023-24
CERTIFICATE
This is to certify that the following students
Sr. No. First Name Middle Name Last Name Roll no.
1. Shruti Prakash Sathe 35
2. Anushka Hanmant Gaikwad 32
3. Snehal Uttam Jadhav 06
4. Shreya Anil Sutar 37
5. Janhvi Jaywant Shinde 38
Has successfully completed the Micro-Project work entitled “calculator
system using python " of Course programming with python (PWP) on of 6th
Semester in partial fulfillment of Diploma in Computer Engineering of
Maharashtra State Board of Technical Education, Mumbai, during the academic
year 2023-2024.
Place: N.M.P.I. Peth.
[Link] [Link] [Link]
Course Coordinator H.O.D. Principal
ACKNOWLEDGEMENT
We take this opportunity to thank all those who have contributed in
successful completion of this micro project work. We would like to express our
sincere thanks to our guide [Link], who has encouraged us to work on
this topic and valuable guidance wherever required.
We wish to express our thanks to [Link], Head of Dept. &
[Link], Principal, N.M.P.I., for their support the help extended.
Finally, we are thankful to all those who extended their help directly or
indirectly in preparation of this report.
Sr. No. First Name Middle Name Last Name Roll no.
1. Shruti Prakash Sathe 35
2. Anushka Hanmant Gaikwad 32
3. Snehal Uttam Jadhav 06
4. Shreya Anil Sutar 37
5. Janhvi Jaywant Shinde 38
Index
[Link] Title Page no.
1 ABSTRACT 1
2 INTRODUCTION 2
3 E-R DIAGRAM 3
4 IMPLEMENTATION 4
5 OUTPUT 7
6 CONCLUSION 10
7 REFERENCE 11
ABSTRACT
The simple calculator is a system software which allows us to perform simple
mathematical operations such as addition, subtraction multiplication, division etc.
To develop this system we have used the concept of class and object first we
defined the class calculator and defined the various function inside this class for
various mathematical operations and each function is different from each other.
After that we prompted user to provide the input for two numbers. And at the end
of the program we have created the object of calculator class and called all the
function defined inside the class one after one for different tasks as per their
respective operations.
1
INTRODUCTION
We shall be breaking down our process of creating the calculator program in
python into simple steps. To help understand the concepts in depth, for creating a
simple calculator program in python which can perform basic mathematical
operations such as addition, subtraction, multiplication, or division, all of which
depend upon the input given by the [Link] approach that we shall be following is
very easy to understand.
• Prompting Input from the User. That is, we shall be accepting input for two
variables.
• Define and Add operators or functions such as add(), subtract(), multiply() and
divide() to estimate respective functions.
• To make it similar to the calculator, apply conditional statements (if…elif…else
branching) to make it works as per User’s choice
2
E-R Diagram
3
IMPLEMENTATION
# pip install tkinter
import tkinter as tk
import [Link]
from [Link] import SUNKEN
window = [Link]()
[Link]('Calculator-GeeksForGeeks')
frame = [Link](master=window, bg="skyblue", padx=10)
[Link]()
entry = [Link](master=frame, relief=SUNKEN, borderwidth=3, width=30)
[Link](row=0, column=0, columnspan=3, ipady=2, pady=2)
def myclick(number):
[Link]([Link], number)
def equal():
try:
y = str(eval([Link]()))
[Link](0, [Link])
[Link](0, y)
except:
[Link]("Error", "Syntax Error")
def clear():
[Link](0, [Link])button_1 = [Link](master=frame, text='1', padx=15,
pady=5, width=3, command=lambda: myclick(1))
button_1.grid(row=1, column=0, pady=2)
button_2 = [Link](master=frame, text='2', padx=15,
pady=5, width=3, command=lambda: myclick(2))
button_2.grid(row=1, column=1, pady=2)
button_3 = [Link](master=frame, text='3', padx=15,
pady=5, width=3, command=lambda: myclick(3))
4
button_3.grid(row=1, column=2, pady=2)
button_4 = [Link](master=frame, text='4', padx=15,
pady=5, width=3, command=lambda: myclick(4))
button_4.grid(row=2, column=0, pady=2)
button_5 = [Link](master=frame, text='5', padx=15,
pady=5, width=3, command=lambda: myclick(5))
button_5.grid(row=2, column=1, pady=2)
button_6 = [Link](master=frame, text='6', padx=15,
pady=5, width=3, command=lambda: myclick(6))
button_6.grid(row=2, column=2, pady=2)
button_7 = [Link](master=frame, text='7', padx=15,
pady=5, width=3, command=lambda: myclick(7))
button_7.grid(row=3, column=0, pady=2)
button_8 = [Link](master=frame, text='8', padx=15,
pady=5, width=3, command=lambda: myclick(8))
button_8.grid(row=3, column=1, pady=2)
button_9 = [Link](master=frame, text='9', padx=15,
pady=5, width=3, command=lambda: myclick(9))
button_9.grid(row=3, column=2, pady=2)
button_0 = [Link](master=frame, text='0', padx=15,
pady=5, width=3, command=lambda: myclick(0))
button_0.grid(row=4, column=1, pady=2)
button_add = [Link](master=frame, text="+", padx=15,
pady=5, width=3, command=lambda: myclick('+'))
button_add.grid(row=5, column=0, pady=2)
button_subtract = [Link](
master=frame, text="-", padx=15, pady=5, width=3, command=lambda:
myclick('-'))
button_subtract.grid(row=5, column=1, pady=2)
button_multiply = [Link](
master=frame, text="*", padx=15, pady=5, width=3, command=lambda:
myclick('*'))
button_multiply.grid(row=5, column=2, pady=2)
button_div = [Link](master=frame, text="/", padx=15,
5
pady=5, width=3, command=lambda: myclick('/'))
button_div.grid(row=6, column=0, pady=2)
button_clear = [Link](master=frame, text="clear",
padx=15, pady=5, width=12,
command=clear)
button_clear.grid(row=6, column=1, columnspan=2, pady=2)
button_equal = [Link](master=frame, text="=", padx=15,
pady=5, width=9, command=equal)
button_equal.grid(row=7, column=0, columnspan=3, pady=2)
[Link]
6
7
8
9
CONCLUSION
We have concluded that we have successfully developed a simple calculator
system which perform the various mathematical operations. We have used the
concept of class and object to implement this system and perform a lot of
customization so that teachers don’t need to change anything. We have provide the
four functions and each function is responsible for their respective tasks. This
project helps to all the user to perform the mathematical operations very easily.
10
REFERENCE
Books:
➢ Python Crash Course
➢ Head First Python
➢ Learn Python the Hard Way
➢ A Byte of Python
Websites:
➢ [Link]
➢ [Link]
➢ [Link]
➢ [Link]
11