Preetpal

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

A

Summer Internship Report (4-6 Weeks)

on

“RESTAURANT MANAGEMENT SYSTEM”

Submitted to

I.K. Gujral Punjab Technical University


Kapurthala

In partial fulfillment of the requirement for the Award of degree


of
Bachelor of Technology
Computer Science and Engineering

Submitted by Institutional Guide

Mr. Rajiv Kumar


Priyanshu
Vishal Kondal
Uni 2128698
Roll No. - 2128876 (Assistant Professor)

(Session 2021-2025)
School of Engineering
Apeejay Institute of Management & Engineering
Technical Campus, Jalandhar
INDUSTRY / TRAINING CERTIFICATE
DECLARATION

I Vishal Kondal (University Roll Number 2128698), student of B.Tech.CSE


Semester-Vth, of Apeejay Institute of Management & Engineering Technical
Campus, Jalandhar hereby declare that the project entitled “Restaurant Management”
is the original work done by me.

Date: Signature of Student

This is to certify that the above statement made by the candidate is correct to the best
of my knowledge

Date: Name & Signature of Supervisor

B.Tech.CSE Semester-Vth Industrial Training Examination has been held on


and accepted.

Signature of Signature of Signature of


Internal Examiner External Examiner Dean
ACKNOWLEDGEMENT

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.

First and foremost, I wish to record our sincere gratitude to SOLITAIRE


INFOSYS coordinates for their constant support and encouragement in
preparation of this report and for making available videos and interface facilities
needed to prepare this report.

The seminar on “python” was very helpful to us in giving the necessary


background information and inspiration in choosing this topic of seminar. Their
contribution and technical support in preparing this report are greatly
acknowledged.

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

Chapter Topic Page no.


1. Learning Objectives 1
2. Introduction to Industry 2
3. Training Overview 3-4
4. Project Overview 5-7
5. Overview of Technology 8-23
6. Final Project 24-36
7. Conclusion 37
8. Bibliography 38
Chapter-1

LEARNING OBJECTIVES/INTERNSHIP OBJECTIVES

The learning objectives of this course are:

➢ To learn basic of Python programming language.

➢ To define the structure and components of a Python program.

➢ To learn how to write functions and pass arguments in Python.

➢ To use lists, tuples, sets and dictionaries in python programs.

➢ To learn how to use and import different Packages in Python.

➢ To learn how to use File handling in Python.

➢ To learn how to use Exception handling in Python for error handling.

➢ To learn how to design object – oriented programs with Python classes.

➢ To learn how to use class inheritance in Python.

➢ To learn how to create Virtual Environment in Python.

➢ To learn how to use Python libraries to create a Web Applications.

1
Chapter-2

INTRODUCTION TO INDUSTRY

Solitaire Infosys Private Limited is a Private incorporated on 06 June 2011. It is


classified as non-govt company and is registered at Registrar of Companies,
Chandigarh. Its authorized share capital is Rs. 900,000 and its paid-up capital is
Rs. 900,000. It is involved in other computer related activities [for example
maintenance of websites of other firms/ creation of multimedia presentations for
other firms etc.

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.

Solitaire Infosys Private Limited's Corporate Identification Number is (CIN)


U72900CH2011PTC033013 and its registration number is 33013.Its Email
address is [email protected] and its registered address is SCO38 FIRST FLOOR,
SECTOR-20-C CHANDIGARH CH 160020 IN.

Current status of Solitaire Infosys Private Limited is - Active.

2
Chapter-3

TRAINING OVERVIEW

DATE NAME OF THE TOPIC


5, JUL.2023 Company Visit
6, JUL.2023 Assets Verification (Warehouse Department)
1-ST 7, JUL.2023 Introduction To Python
WEEK 8, JUL.2023 Variables & Data Types
10, JUL.2023 Operators
11, JUL.2023 If-else Statements

DATE NAME OF THE TOPIC


12, JUL.2023 Looping Statements (For Loop, While Loop)
13, JUL.2023 Looping Statements (Do While Loop) & Mini
Project On The Basis Of Looping Statements
2-ND 14, JUL.2023 Break, Continue, Pass Statements
WEEK 15, JUL.2023 Implementation The Above Concepts
17, JUL.2023 Type Conversion & Strings
18, JUL.2023 Python Collections (Lists, Tuples, Dictionary,
Sets)

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

DATE NAME OF THE TOPIC


26, JUL.2023 PROGRAMMING EXERCISE
5-TH 27, JUL.2023 CONTINUE CODING EXERCISE
6TH 28, JUL.2023 CONTINUE CODING EXERCISE
WEEK 29, JUL.2023 INTRO TO TKINTER
30,JUL.2023 INTRO TO TKINTER

4
Chapter-4

PROJECT OVERVIEW

A restaurant management system in Python typically involves creating a program to


handle various aspects of restaurant operations. It is a comprehensive software solution
designed to streamline and optimize various operations within a restaurant. It typically
encompasses a range of functions to enhance efficiency, customer service, and overall
business management

Here's a simple outline for such a system:

• 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.

• Order Processing: Enable staff to take customer orders.

• Billing and Payments: Generate bills for completed orders.

• Security Features: Ensure secure access and data protection.

• Graphical User Interface (GUI): Develop a user-friendly interface for staff


interactions.

5
REQUIREMENT GATHERING:

HARDWARE REQUIREMENTS:

Operating Systems:

Windows 7 or 10

Mac OS X 10.11 or higher, 64-bit

CPU Architecture:

Dual-core or Intel Core i5 or similar

Graphics card:

x86 64-bit CPU (Intel / AMD architecture)

RAM and free disk space:

4 GB RAM

5 GB free disk space

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.

The Jupyter Notebook is made up of the three components listed below:

1. The notebook web application: It is an interactive web application that allows


you to write and run code.

2. Kernels: The independent processes launched by the notebook web application


are known as kernels, and they are used to execute user code in the specified
language and return results to the notebook web application.

3. Notebook documents: All content viewable in the notebook online application,


including calculation inputs and outputs, text, mathematical equations, graphs,
and photos, is represented in the notebook document.

Types of cells: There are mainly three types of cells used in jupyter notebook

1. Code Cell: The contents present in a code cell is treated as statements in a


programming language of the current kernel.
2. Markdown Cell: It provides documentation to the notebook and makes the
notebook more attractive.
3. Raw NBConvert Cell: It provides a place where you can write output directly.
These cells are not evaluated by the notebook kernel.

7
Chapter-5

OVERVIEW OF TECHNOLOGY

INTRODUCTION TO PYTHON:

❖ Python is a general purpose, dynamic, high-level, and interpreted programming


language.

❖ It supports Object Oriented programming approach to develop applications.

❖ 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 supports multiple programming pattern, including object-oriented,


imperative, and functional or procedural programming styles.

❖ 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:

❖ Python was invented by Guido van Rossum in 1991 at CWI in Netherland.

❖ 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.

❖ Easy to use and Learn.

❖ Expressive Language.

❖ Interpreted Language.

❖ Object-Oriented Language.

❖ Open Source Language.

❖ Extensible.

❖ Learn Standard Library.

❖ GUI Programming Support.

❖ Integrated.

❖ Embeddable.

❖ Dynamic Memory Allocation.

❖ Wide Range of Libraries and Frameworks

9
WHERE IS PYTHON USED?:

Python is a general-purpose, popular programming language and it is used in almost


every technical field. The various areas of Python use are given below.

❖ Data Science.

❖ Date Mining.

❖ Desktop Applications.

❖ Console-based Applications.

❖ Mobile Applications.

❖ Software Development.

❖ Artificial Intelligence.

❖ Web Applications.

❖ Enterprise Applications.

❖ 3D CAD Applications.

❖ Machine Learning.

❖ Computer Vision or Image Processing Applications.

PYTHON POPULAR FRAMEWORKS AND LIBRARIES:

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.

❖ Web development (Server-side) - Django Flask, Pyramid, CherryPy.

❖ GUIs based applications - Tk, PyGTK, PyQt, PyJs, etc.

❖ Machine Learning - TensorFlow, PyTorch, Scikit-learn, Matplotlib, Scipy, etc.

10
DATA TYPES:

❖ In programming, data type is an important concept.

❖ 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:

❖ NUMBERS DATA TYPE:

❖ Number stores numeric values.

❖ 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.

❖ Python has no restriction on the length of an integer.

❖ Its value belongs to int.

2. FLOAT:

❖ Float is used to store floating-point numbers like 1.9, 9.902, 15.2, etc.

❖ It is accurate upto 15 decimal points.

3. COMPLEX:

❖ A complex number contains an ordered pair, i.e., x + iy where x and y denote the real
and imaginary parts, respectively.

❖ The complex numbers like 2.14j, 2.0 + 2.3j, etc.

12
INTRO TO TKINTER:

❖ Tkinter tutorial provides basic and advanced concepts of Python Tkinter.


❖ Python provides the standard library Tkinter for creating the graphical user interface
for desktop based applications.
❖ Developing desktop based applications with python Tkinter is not a complex task.

An empty Tkinter top-level window can be created by using the following steps.

STEP 1: import the Tkinter module.


STEP 2: Create the main application window.
STEP 3: Add the widgets like labels, buttons, frames, etc. to the window.
STEP 4: Call the main event loop so that the actions can take place on the user's
computer screen.

EXAMPLE

from tkinter import *


top = Tk()
top.mainloop()

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 python Tkinter provides the following geometry methods.

1. The pack() method.

2. The grid() method.

3. The place() method.

1. PYTHON TKINTER PACK() METHOD:

❖ The pack() widget is used to organize widget in the block.

❖ 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)

A list of possible options that can be passed in pack() is given below.

1. EXPAND:

If the expand is set to true, the widget expands to fill any space.

2. FILL:

By default, the fill is set to NONE. However, we can set it to X or Y to determine


whether the widget contains any extra space.

3. SIZE:

It represents the side of the parent to which the widget is to be placed on the wind1 o5 w.
EXAMPLE

from tkinter import *

parent = Tk()

redbutton = Button(parent, text = "Red", fg = "red")

redbutton.pack( side = LEFT)

greenbutton = Button(parent, text = "Black", fg = "black")

greenbutton.pack( side = RIGHT )

bluebutton = Button(parent, text = "Blue", fg = "blue")

bluebutton.pack( side = TOP )

blackbutton = Button(parent, text = "Green", fg = "red")

blackbutton.pack( side = BOTTOM)

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.

❖ We can also specify the column span (width) or rowspan(height) of a widget.

❖ 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.

❖ It may be N, E, W, S, NE, NW, NS, EW, ES.

EXAMPLE:

from tkinter import *

parent = Tk()

name = Label(parent,text = "Name").grid(row = 0, column = 0)

e1 = Entry(parent).grid(row = 0, column = 1)

password = Label(parent,text = "Password").grid(row = 1, column = 0)

e2 = Entry(parent).grid(row = 1, column = 1)

submit = Button(parent, text = "Submit").grid(row = 4, column = 0)

parent.mainloop()

18
OUTPUT:

3. PYTHON TKINTER PLACE() METHOD:

The place() geometry manager organizes the widgets to the specific x and y coordinates.

SYNTAX:

widget.place(options).

A list of possible options is given below:

1. ANCHOR:

❖ It represents the exact position of the widget within the container.


❖ The default value (direction) is NW (the upper left corner).

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.

5. X, Y: It refers to the horizontal and vertical offset in the pixels.

EXAMPLE:

from tkinter import *


top = Tk()
top.geometry("400x250")
name = Label(top, text = "Name").place(x = 30,y = 50)
email = Label(top, text = "Email").place(x = 30, y = 90)
password = Label(top, text = "Password").place(x = 30, y = 130)
e1 = Entry(top).place(x = 80, y = 50)
e2 = Entry(top).place(x = 80, y = 90)
e3 = Entry(top).place(x = 95, y = 130)
top.mainloop()
OUTPUT:

20
ENTRY WIDGET METHODS:

Python provides various methods to configure the data written inside the widget.

There are the following methods provided by the Entry widget:

21
EXAMPLE

import tkinter as tk

from functools import partial

def call_result(label_result, n1, n2):

num1 = (n1.get())

num2 = (n2.get())

result = int(num1) + int(num2)

label_result.config(text="Result = %d" % result)

return

root = tk.Tk()

root.geometry('400x200+100+200')

root.title('Calculator')

number1 = tk.StringVar()

number2 = tk.StringVar()

labelNum1 = tk.Label(root, text="A").grid(row=1, column=0)

labelNum2 = tk.Label(root, text="B").grid(row=2, column=0)

labelResult = tk.Label(root)

labelResult.grid(row=7, column=2)

22
entryNum1 = tk.Entry(root, textvariable=number1).grid(row=1, column=2)

entryNum2 = tk.Entry(root, textvariable=number2).grid(row=2, column=2)

call_result = partial(call_result, labelResult, number1, number2)

buttonCal = tk.Button(root, text="Calculate", command=call_result).grid(row=3,


column=0)

root.mainloop()

OUTPUT:

FIG. 1.1 WITHOUT ENTRY

FIG. 1.2 AFTER ENTRY & CALCULATE THE RESULT

23
Chapter-6
FINAL PROJECT

from tkinter import *

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)

optionFrame = Frame(root , bg="grey")


optionFrame.pack()

frame2 = Frame(root , bg="yellow")


frame2.pack()

board = { 1:" " , 2:" " , 3:" ",


4:" " , 5:" " , 6:" ",
7:" " , 8:" " , 9:" " }

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

elif board[4] == board[5] and board[5] == board[6] and board[6] == player:


return True

elif board[7] == board[8] and board[8] == board[9] and board[9] == player:

3
7
return True

# columns
elif board[1] == board[4] and board[4] == board[7] and board[7] == player:
return True

elif board[2] == board[5] and board[5] == board[8] and board[8] == player:


return True

elif board[3] == board[6] and board[6] == board[9] and board[9] == player:


return True

# diagonals
elif board[1] == board[5] and board[5] == board[9] and board[9] == player:
return True

elif board[3] == board[5] and board[5] == board[7] and board[7] == 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] = " "

titleLabel = Label(frame1 , text="Tic Tac Toe" , font=("Arial" , 30) , bg="orange" ,


width=15 )
titleLabel.grid(row=0 , column=0)

def minimax(board , isMaximizing):

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

for key in board.keys():


if board[key] == " ":
board[key] = "x"
score = minimax(board , True) # minimax
board[key] = " "
if score < bestScore :
bestScore = score

return bestScore

def playComputer():
bestScore = -100
bestMove = 0

for key in board.keys():

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)

if button["text"] == " ":


if turn == "x" :
board[clicked] = turn
if checkForWin(turn):

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 --------

# Change Mode options

singlePlayerButton = Button(optionFrame , text="SinglePlayer" , width=13 , height=1 ,


font=("Arial" , 15) , bg="lightgrey" , relief=RAISED , borderwidth=5 ,
command=changeModeToSinglePlayer)
singlePlayerButton.grid(row=0 , column=0 , columnspan=1 , sticky=NW)

multiPlayerButton = Button(optionFrame , text="Multiplayer" , width=13 , height=1 ,


font=("Arial" , 15) , bg="lightgrey" , relief=RAISED , borderwidth=5 ,
command=changeModeToMultiplayer )
multiPlayerButton.grid(row=0 , column=1 , columnspan=1 , sticky=NW)

# Tic Tac Toe Board

3
13
# First row

button1 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30) ,


bg="yellow" , relief=RAISED , borderwidth=5)
button1.grid(row = 0 , column=0)
button1.bind("<Button-1>" , play)

button2 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button2.grid(row = 0 , column=1)
button2.bind("<Button-1>" , play)

button3 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button3.grid(row = 0 , column=2)
button3.bind("<Button-1>" , play)

# second row

button4 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button4.grid(row = 1 , column=0)
button4.bind("<Button-1>" , play)

button5 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button5.grid(row = 1 , column=1)

3
14
button5.bind("<Button-1>" , play)

button6 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button6.grid(row = 1 , column=2)
button6.bind("<Button-1>" , play)

# third row

button7 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30) ,


bg="yellow" , relief=RAISED , borderwidth=5)
button7.grid(row = 2 , column=0)
button7.bind("<Button-1>" , play)

button8 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30),


bg="yellow" , relief=RAISED , borderwidth=5 )
button8.grid(row = 2 , column=1)
button8.bind("<Button-1>" , play)

button9 = Button(frame2 , text= " " , width=4 , height=2 , font=("Arial" , 30) ,


bg="yellow" , relief=RAISED , borderwidth=5)
button9.grid(row = 2 , column=2)
button9.bind("<Button-1>" , play)

restartButton = Button(frame2 , text="Restart Game" , width=19 , height=1 , font=("Arial"


, 20) , bg="Green" , relief=RAISED , borderwidth=5 , command=restartGame )
restartButton.grid(row=4 , column=0 , columnspan=3)

3
15
buttons = [button1 , button2 , button3 , button4 , button5 , button6 , button7 , button8,
button9]
root.mainloop()
Output:

FIG.1.1 INTERFACE OF TICKTACKTOE


3
16
OUTPUT:

FIG. 1.2 ZERO WINS

3
17
OUTPUT:-

FIG 1.13. X WINS

3
18
OUTPUT:-

FIG.1.14 MATCH DRAW BETWEEN ZERO AND X

3
19
OUTPUT:-

FIG1.15 GAME RESET AFTER CLICK ON RESET BUTTON

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

• Sharma,Pooja., Programming in python,


• BPB Publishers, New Delhi

ONLINE REFERENCES

• Introduction to python, URL: https://www.geeksforgeeks.org/introduction-to-python/


• Introduction to Tkinter, URL: https://www.geeksforgeeks.org/python-gui-tkinter/
• Tkinter widgets, URL: https://www.w3schools.in/python/gui-programming
• Python Functions, URL: https://www.geeksforgeeks.org/python-functions/

3
22

You might also like