Preetpal
Preetpal
Preetpal
on
Submitted to
(Session 2021-2025)
School of Engineering
Apeejay Institute of Management & Engineering
Technical Campus, Jalandhar
INDUSTRY / TRAINING CERTIFICATE
DECLARATION
This is to certify that the above statement made by the candidate is correct to the best
of my knowledge
It is my proud privilege and duty to acknowledge the kind of help and guidance
received from several people in preparation of this report. It would not have been
possible to prepare this report in this form without their valuable help, cooperation
and guidance.
Last but not the least, we wish to thank our parents for financing our studies in
this college as well as for constantly encouraging us to learn engineering. Their
personal sacrifice in providing this opportunity to learn engineering is greatfully
acknowledged.
ABSTRACT OF THE PROJECT
This work was centered on the Design and implementation of a simple scientific
calculator for education organization. The study traced calculator system as a tool
to completely change mathematical knowledge and sophisticated problems
solving strategies had advanced the field of simulated engine in mathematic.
This project work also focused principally on numbers and arithmetic operation.
This researcher investigated the manual system in detail with a view to finding out
the need to automate the system.
Interestingly, the end result of simple calculator system was its ability to process
number and operators, and provides a useful result.
Therefore, this project will help immensely in the following way. Easy calculating
of tedious mathematical problems, easy to retrieval of errors and it will also be of
a good assistance to any researcher on these topics.
TABLE OF CONTENTS/INDEX
1
Chapter-2
INTRODUCTION TO INDUSTRY
Solitaire Infosys Private Limited's Annual General Meeting (AGM) was last held
on N/A and as per records from Ministry of Corporate Affairs (MCA), its balance
sheet was last filed on 31 March 2020.
Directors of Solitaire Infosys Private Limited are Joginder Singh and Rajesh
Sharma.
2
Chapter-3
TRAINING OVERVIEW
3
DATE NAME OF THE TOPIC
19, JUL.2023 Lists, Tuples
3-RD 20, JUL.2023 Sets & Dictionary
4TH 21, JUL.2023 Implementation The Above Concepts
WEEK 22, JUL.2023 File Handling Basics
24, JUL.2023 File Access Mode
25, JUL.2023 Continue File Handling
4
Chapter-4
PROJECT OVERVIEW
• User Authentication: Implement a login system for restaurant staff with different
roles (e.g., manager, waiter, chef).
• Menu Management: Create a menu with items, prices, and categories. Allow for
adding, updating, and deleting menu items.
5
REQUIREMENT GATHERING:
HARDWARE REQUIREMENTS:
Operating Systems:
Windows 7 or 10
CPU Architecture:
Graphics card:
4 GB RAM
6
SOFTWARE REQUIREMENTS:
Jupyter Notebook is an open-source web application that allows you to create and
share documents that contain live code, equations, visualizations, and narrative
text. It supports more than 40 programming languages, it is a flexible option for
a range of computational jobs. Because the notebook interface is web- based, users
may use their web browsers to interact with it.
Types of cells: There are mainly three types of cells used in jupyter notebook
7
Chapter-5
OVERVIEW OF TECHNOLOGY
INTRODUCTION TO PYTHON:
❖ It is simple and easy to learn and provides lots of high-level data structures.
❖ Python is easy to learn yet powerful and versatile scripting language, which makes it
attractive for Application Development.
❖ Python's syntax and dynamic typing with its interpreted nature make it an ideal
language for scripting and rapid application development.
❖ Python is not intended to work in a particular area, such as web programming. That
is why it is known as multipurpose programming language because it can be used
with web, enterprise, 3D CAD, etc.
PYTHON HISTORY:
❖ The idea of Python programming language has taken from the ABC programming
language or we can say that ABC is a predecessor of Python language.
❖ Guido van Rossum was a fan of the BBC comedy show of that time, "Monty
Python's Flying Circus". So he decided to pick the name Python.
8
WHY LEARN PYTHON?:
Python provides many useful features to the programmer. These features make it most
popular and widely used language. We have listed below few-essential feature of
Python.
❖ Expressive Language.
❖ Interpreted Language.
❖ Object-Oriented Language.
❖ Extensible.
❖ Integrated.
❖ Embeddable.
9
WHERE IS PYTHON USED?:
❖ Data Science.
❖ Date Mining.
❖ Desktop Applications.
❖ Console-based Applications.
❖ Mobile Applications.
❖ Software Development.
❖ Artificial Intelligence.
❖ Web Applications.
❖ Enterprise Applications.
❖ 3D CAD Applications.
❖ Machine Learning.
Python has wide range of libraries and frameworks widely used in various fields such as
machine learning, artificial intelligence, web applications, etc. We define some popular
frameworks and libraries of Python as follows.
10
DATA TYPES:
❖ Variables can store data of different types, and different types can do different things.
❖ Python has the following data types built-in by default, in these categories:
❖ The integer, float, and complex values belong to a Python Numbers data-type.
❖ Python provides the type() function to know the data-type of the variable.
11
Number data type can be divided into 3-categories are given below:
1. INT:
❖ Integer value can be any length such as integers 10, 2, 29, -20, -150 etc.
2. FLOAT:
❖ Float is used to store floating-point numbers like 1.9, 9.902, 15.2, etc.
3. COMPLEX:
❖ A complex number contains an ordered pair, i.e., x + iy where x and y denote the real
and imaginary parts, respectively.
12
INTRO TO TKINTER:
An empty Tkinter top-level window can be created by using the following steps.
EXAMPLE
OUTPUT:
13
TKINTER WIDGETS:
There are various widgets like button, canvas, checkbutton, entry, etc. that are used to
build the python GUI applications.
14
PYTHON TKINTER GEOMETRY:
The Tkinter geometry specifies the method by using which, the widgets are represented
on display.
❖ The positions widgets added to the python application using the pack() method can
be controlled by using the various options specified in the method call.
❖ The controls are less and widgets are generally added in the less organized manner.
SYNTAX:
widget.pack(options)
1. EXPAND:
If the expand is set to true, the widget expands to fill any space.
2. FILL:
3. SIZE:
It represents the side of the parent to which the widget is to be placed on the wind1 o5 w.
EXAMPLE
parent = Tk()
parent.mainloop()
OUTPUT:
16
2. PYTHON TKINTER GRID() METHOD:
❖ The grid() geometry manager organizes the widgets in the tabular form.
❖ We can specify the rows and columns as the options in the method call.
❖ This is a more organized way to place the widgets to the python application. The
syntax to use the grid() is given below.
SYNTAX:
widget.grid(options)
A list of possible options that can be passed inside the grid() method is given below:
1. COLUMN
The column number in which the widget is to be placed. The leftmost column is
represented by 0.
2. COLUMNSPAN:
The width of the widget. It represents the number of columns up to which, the column is
expanded.
3. IPADX, IPADY:
It represents the number of pixels to pad the widget inside the widget's border.
4. PADX, PADY:
It represents the number of pixels to pad the widget outside the widget's border.
17
5. ROW:
The row number in which the widget is to be placed. The topmost row is represented by
0.
6. ROWSPAN:
The height of the widget, i.e. the number of the row up to which the widget is expanded.
7. STICKY:
❖ If the cell is larger than a widget, then sticky is used to specify the position of the
widget inside the cell.
❖ It may be the concatenation of the sticky letters representing the position of the
widget.
EXAMPLE:
parent = Tk()
e1 = Entry(parent).grid(row = 0, column = 1)
e2 = Entry(parent).grid(row = 1, column = 1)
parent.mainloop()
18
OUTPUT:
The place() geometry manager organizes the widgets to the specific x and y coordinates.
SYNTAX:
widget.place(options).
1. ANCHOR:
2. BORDERMODE:
❖ The default value of the border type is INSIDE that refers to ignore the parent's
inside the border.
❖ The other option is OUTSIDE.
3. HEIGHT, WIDTH:
19
It refers to the height and width in pixels.
4. RELHEIGHT, RELWIDTH:
It is represented as the float between 0.0 and 1.0 indicating the fraction of the parent's
height and width.
EXAMPLE:
20
ENTRY WIDGET METHODS:
Python provides various methods to configure the data written inside the widget.
21
EXAMPLE
import tkinter as tk
num1 = (n1.get())
num2 = (n2.get())
return
root = tk.Tk()
root.geometry('400x200+100+200')
root.title('Calculator')
number1 = tk.StringVar()
number2 = tk.StringVar()
labelResult = tk.Label(root)
labelResult.grid(row=7, column=2)
22
entryNum1 = tk.Entry(root, textvariable=number1).grid(row=1, column=2)
root.mainloop()
OUTPUT:
23
Chapter-6
FINAL PROJECT
root = Tk()
root.geometry("330x550")
root.title("Tic Tac Toe")
root.resizable(0,0)
frame1 = Frame(root)
frame1.pack()
titleLabel = Label(frame1 , text="Tic Tac Toe" , font=("Arial" , 26) , bg="orange" ,
width=16 )
titleLabel.grid(row=0 , column=0)
turn = "x"
3
6
game_end = False
mode = "singlePlayer"
def changeModeToSinglePlayer():
global mode
mode = "singlePlayer"
singlePlayerButton["bg"] = "lightgreen"
multiPlayerButton["bg"] = "lightgrey"
def changeModeToMultiplayer():
global mode
mode = "multiPlayer"
multiPlayerButton["bg"] = "lightgreen"
singlePlayerButton["bg"] = "lightgrey"
def updateBoard():
for key in board.keys():
buttons[key-1]["text"] = board[key]
def checkForWin(player):
# rows
if board[1] == board[2] and board[2] == board[3] and board[3] == player:
return True
3
7
return True
# columns
elif board[1] == board[4] and board[4] == board[7] and board[7] == player:
return True
# diagonals
elif board[1] == board[5] and board[5] == board[9] and board[9] == player:
return True
return False
def checkForDraw():
for i in board.keys():
if board[i] == " ":
return False
return True
3
8
def restartGame():
global game_end
game_end = False
for button in buttons:
button["text"] = " "
for i in board.keys():
board[i] = " "
if checkForWin("o"):
return 1
if checkForWin("x"):
return -1
if checkForDraw():
return 0
if isMaximizing:
bestScore = -100
3
9
for key in board.keys():
if board[key] == " ":
board[key] = "o"
score = minimax(board , False) # minimax
board[key] = " "
if score > bestScore :
bestScore = score
return bestScore
else:
bestScore = 100
return bestScore
def playComputer():
bestScore = -100
bestMove = 0
3
10
if board[key] == " ":
board[key] = "o"
score = minimax(board , False) # minimax
board[key] = " "
if score > bestScore :
bestScore = score
bestMove = key
board[bestMove] = "o"
# Function to play
def play(event):
global turn,game_end
if game_end:
return
button = event.widget
buttonText = str(button)
clicked = buttonText[-1]
if clicked == "n" :
clicked = 1
else :
clicked = int(clicked)
3
11
winningLabel = Label(frame1 , text=f"{turn} wins the game", bg="orange",
font=("Arial" , 26),width=16 )
winningLabel.grid(row = 0 , column=0 , columnspan=3)
game_end = True
turn = "o"
updateBoard()
if mode == "singlePlayer":
playComputer()
if checkForWin(turn):
winningLabel = Label(frame1 , text=f"{turn} wins the game", bg="orange",
font=("Arial" , 26),width=16 )
winningLabel.grid(row = 0 , column=0 , columnspan=3)
game_end = True
turn = "x"
updateBoard()
else:
board[clicked] = turn
updateBoard()
3
12
if checkForWin(turn):
winningLabel = Label(frame1 , text=f"{turn} wins the game" , bg="orange",
font=("Arial" , 26),width=16)
winningLabel.grid(row = 0 , column=0 , columnspan=3)
game_end = True
turn = "x"
if checkForDraw():
drawLabel = Label(frame1 , text=f"Game Draw" , bg="orange", font=("Arial" ,
26), width = 16)
drawLabel.grid(row = 0 , column=0 , columnspan=3)
# ------ UI --------
3
13
# First row
# second row
3
14
button5.bind("<Button-1>" , play)
# third row
3
15
buttons = [button1 , button2 , button3 , button4 , button5 , button6 , button7 , button8,
button9]
root.mainloop()
Output:
3
17
OUTPUT:-
3
18
OUTPUT:-
3
19
OUTPUT:-
3
20
CONCLUSION:
Hopefully, I have gained a better idea of what a PYTHON developer actually does and
what my life might look like if I decided to take it on as a career. This has only been a
teaser into the world of python. In this Training course, I took a journey through the entire
spectrum of topics that I eventually needed to know. This Training has told me a variety
of topics that I might’ve been totally unfamiliar with, providing me a small taste of each
and then moving on. I’ve built dozens of scripts, projects, and websites to cement my
skills that will get me hired.
3
21
BIBLIOGRAPHY:
BOOK REFRENCES
ONLINE REFERENCES
3
22