EVERWIN VIDHYASHRAM
(Affiliated to the Central Board of Secondary Education, New Delhi)
COMPUTER SCIENCE WITH PYTHON
INVESTIGATORY PROJECT
IPL TICKET BOOKING
DONE BY:
Rehan Raza Salik Ansar Shaikh
XII SMART
CERTIFACTE
This is to certify that the project entitled “IPL TICKET BOOKING”
Is a record of bonafide work carries out by “REHAN RAZA SALIK
ANSAR SHAIKH” of XII SMART. In partial fulfillment of the
requirements in COMPUTER SCIENCE as prescribed by CBSE
BOARD 2024-2025 in the school EVERWIN VIDHYASHARAM
SENIOR SECONDARY SCHOOL,PERAMBUR,CHENNAI-600011
DATE: PRINCIPLE:
INTERNAL EXAMINAR EXTERNAL EXAMINAR
DECLARATION
We hereby declare that the project work entitled “IPL
TICKET BOOKING” submitted to EVERWIN
VIDHYASHARAM SENIOR SECONDARY
SCHOOL,PERAMBUR,CHENNAI for the subject of
“COMPUTER SCIENCE” under the guidance Ms.
SADAFNISA,PGT(COMPUTER SCIENCE),is an original
work done by us.
DATE: PLACE:
ACKNOWLEDGEMENT
We wish to express our sincere thanks to
[Link],Principle of EVERWIN VIDHYASHARAM SENIOR
SECONDARY SCHOOL,PERAMBUR,CHENNAI for guiding us for
the successful outcome of this project work.
We wish to express our deep & profound of gratitude of our
guide/teacher [Link],PGT(Computer
Science),for her expert help & valuble guidance,comments
and suggestions.
We also place on record,our since gratitude to one and all
who,directly or indirectly have lent their helping hand in this
venture.
INTRODUCTION TO PYTHON
Python is a versatile and high-level programming language known for
its simplicity, readability, and flexibility. It was created by Guido van
Rossum and first released in 1991. Python is an interpreted language,
which means that code is executed line by line at runtime rather than
being compiled before execution. This characteristic makes Python an
excellent choice for scripting and rapid development.
1. Readable and Expressive Syntax: Python code is
easy to read and understand, thanks to its clean and
straightforward syntax. It uses indentation to define code
blocks, making it visually appealing and encouraging proper
code structuring.
2. Dynamically Typed: Python is dynamically typed, which
means you don't need to explicitly declare variable types. The
interpreter automatically assigns types based on the value
assigned to the variable.
3. Cross-Platform Compatibility: Python is a cross-
platform language, which means you can run Python code on
various operating systems such as Windows, macOS, Linux,
etc., without any modifications.
4. Large Standard Library: Python comes with a vast
standard library that provides numerous modules and packages
to perform various tasks, ranging from working with files,
networking, web development, scientific computing, and more.
5. Open Source and Community-driven: Python is an
open-source language, and its development is supported by a
large and active community. This ensures continuous
improvement, updates, and a wealth of resources available for
learners and developers.
6. Object-Oriented Programming (OOP): Python
supports object-oriented programming, allowing
developers to create reusable and modular code using
classes and objects.
7. Extensibility: Python can be easily extended by integrating
code from other languages, like C or C++, allowing developers
to optimize performance for critical sections of their program.
8. Module Creation and Packages: Advanced Python
developers create custom modules and packages to organize
code into reusable and distributable components. They learn to
structure projects and manage dependencies effectively.
9. Game Development Libraries: Python offers
several game development libraries and frameworks to
simplify the process.
ADVANTAGES OF PYTHON
1. Easy to Learn and Read: Python has a simple and clean
syntax that makes it easy to learn, read, and write code. Its
readability reduces the cost of program maintenance and
encourages collaboration among developers.
2. Expressive and Productive: Python's concise and
expressive nature allows developers to accomplish more with
fewer lines of code. This leads to faster development and
increased productivity.
3. Cross-Platform Compatibility: Python is a cross-
platform language, meaning it can run on various operating
systems without any modifications. Code written on one
platform can seamlessly run on others.
4. Large Standard Library: Python comes with an
extensive standard library that offers ready-to-use modules and
functions for various tasks. This "batteries-included" approach
saves time and effort for developers.
5. Vast Ecosystem of Libraries and Frameworks:
Python has a rich ecosystem of third-party libraries and
frameworks that cater to a wide range of domains, such as web
development, data science, machine learning, game
development, and more.
6. Support for Multiple Paradigms: Python supports
multiple programming paradigms, including procedural, object-
oriented, and functional programming. This flexibility allows
developers to choose the approach that suits their project best.
7. Strong Community and Support: Python has a large
and active community of developers, users, and contributors.
The community provides extensive documentation, tutorials,
and forums for support and collaboration.
8. Integration and Extensibility: Python can easily integrate
with other languages like C and C++, allowing developers to
optimize performance-critical parts of their code. It's also
widely used as a scripting language to control and automate
other software.
9. Open Source and Free: Python is an open-source language,
which means it's free to use, distribute, and modify. This makes
it accessible to everyone and fosters innovation.
10. Scalable and Versatile: Python is suitable for both
small-scale and large-scale projects. It has been used to
develop everything from simple scripts to complex applications
used by major companies and organizations.
11. Rapid Prototyping and Development: Python's ease
of use and quick development cycle make it an ideal choice for
prototyping and iterating on ideas swiftly.
12. Wide Adoption in Industry: Python's popularity has
grown significantly over the years, and it is now widely adopted
in various industries, including tech, finance, healthcare,
education, and scientific research.
INTRODUCTION TO IPL TICKET BOOKING
1. Ticket Availability: IPL tickets are usually made available for
purchase before the start of the tournament. The exact date of
ticket availability is announced by the tournament organizers and
respective franchise teams
.Online Booking: The most convenient and popular wayto
book IPL tickets is through online platforms. Several
authorized ticketing websites and apps collaborate with the
IPL and respective teams to sell tickets online.
Authorized Outlets: In addition to online platforms, there
might be authorized physical ticket counters or outlets where you
can purchase tickets in person. These outlets are typically located in
the host cities.
1. Choose the Match and Venue: IPL consists of several
matches, and each franchise plays home matches in their respective
cities. You can select the specific match and venue you wish to
attend while booking tickets.
Seating Categories: IPL stadiums usually offer different
seating categories with varying ticket prices. These categories may
include general admission, corporate boxes, premium seats, etc.
The prices and availability of seats depend on the popularity of the
match wallets, etc., making it easy and convenient for fans to
purchasetickets.
2. Ticket Delivery: After successful booking and payment, you
will receive an e-ticket or a QR code that you can either print or save
on your mobile device. This will serve as your entry pass to the
stadium.
3. Terms and Conditions: Before booking the tickets, it's
essential to read and understand the terms and conditions related to
ticket booking, cancellation policies, and entry guidelines issued by
the IPL organizers and the respective franchise teams.
Security and Safety: To ensure the safety and security of all
spectators, the IPL and stadium authorities implement strict
security measures and entry protocols. It's important for ticket
holders to cooperate with the security checks for a smooth entry
intothe stadium. wallets, etc., making it easy and convenient for
fans to purchasetickets.
4. Ticket Delivery: After successful booking and payment, you
will receive an e-ticket or a QR code that you can either print or save
on your mobile device. This will serve as your entry pass to the
stadium.
5. Terms and Conditions: Before booking the tickets, it's
essential to read and understand the terms and conditions related to
ticket booking, cancellation policies, and entry guidelines issued by
the IPL organizers and the respective franchise teams.
6. Security and Safety: To ensure the safety and security of
all spectators, the IPL and stadium authorities implement strict
security measures and entry protocols. It's important for ticket
holders to cooperate with the security checks for a smooth entry into
the stadium.
wallets, etc., making it easy and convenient for fans to purchase
tickets.
7. Ticket Delivery: After successful booking and payment, you
will receive an e-ticket or a QR code that you can either print or save
on your mobile device. This will serve as your entry pass to the
stadium.
8. Terms and Conditions: Before booking the tickets, it's
essential to read and understand the terms and conditions related to
ticket booking, cancellation policies, and entry guidelines issued by
the IPL organizers and the respective franchise teams.
9. Security and Safety: To ensure the safety and security of
all spectators, the IPL and stadium authorities implement strict
security measures and entry protocols. It's important for ticket
holders to cooperate with the security checks for a smooth entry into
the stadium.
ADVANTAGES
1. Live Experience: Booking IPL tickets allows you to witness
the cricketing action live in the stadium. The electrifying atmosphere,
the cheers of fellow fans, and the overall excitement of being part of
the crowd create a memorable experience that cannot be replicated
through television.
2. Cheering for Your Team: If you have a favorite IPL team,
watching their matches in person lets you cheer and support them
directly from the stands. Your enthusiasm and support can boost the
morale of the players and make you feel more connected to the
team.
3. Unmatched Excitement: IPL matches are known for their
high-octane, thrilling cricket. From nail-biting finishes to spectacular
performances, being present at the stadium adds an extra layer of
excitement to the game.
4. See Star Players in Action: The IPL attracts top-notch
cricketers from around the world. Booking tickets allows you to
witness legendary players and emerging talents showcasing their
skills on the field.
5. Selection of Seating Category: When booking IPL tickets,
you have the flexibility to choose the seating category that suits your
preferences and budget. Whether you want to be close to the action
or enjoy a premium view, various ticket categories cater to different
needs.
6. Online Convenience: IPL ticket booking can be done
conveniently online. You can use authorized ticketing websites or
mobile apps to browse available matches, select seats, and make
secure payments, all from the comfort of your home.
7. Transparency: Authorized ticketing platforms ensure
transparency in ticket pricing and availability. You can see the seat
layout and know exactly what you're paying for.
8. Early Bird Offers and Discounts: Some ticketing
platforms offer early bird offers and discounts for booking tickets
well in advance. Availing such deals can help you save money on your
ticket purchase.
9. Collectible Souvenirs: Some IPL matches may have special
promotional giveaways or souvenirs for spectators, which can serve
as cherished mementos of your experience at the game.
10. Social Experience: Attending an IPL match allows you to
connect with fellow cricket enthusiasts, share your passion for the
sport, and be part of a community that shares the same love for the
game.
SCOPE
1. Massive Fan Base: The IPL enjoys an enormous fan following
not only in India but also globally. People from different parts of the
world eagerly look forward to attending IPL matches, either in
person or through online streaming platforms. The massive fan base
ensures a huge demand for IPL tickets.
2. Economic Impact: IPL ticket booking has a significant
economic impact on the host cities and the country as a whole. The
influx of fans and tourists during the tournament generates revenue
for local businesses, including hotels, restaurants, transportation
services, and retail outlets.
3. Tourism Boost: IPL matches attract cricket enthusiasts from
different cities and countries, resulting in a boost in tourism for the
host cities. Fans often plan trips around the tournament, leading to
increased hotel bookings and tourist activities.
4. Job Creation: The IPL creates temporary job opportunities in
ticketing management, event organization, security, hospitality, and
other related sectors during the tournament, providing employment
to numerous individuals.
5. Brand Promotion: For companies and brands associated with
the IPL, ticket booking becomes an avenue to promote their products
and services. Sponsors and partners often run promotional
campaigns offering tickets as rewards or incentives.
6. Technological Advancements: The popularity of IPL
ticket booking has encouraged the development and implementation
of advanced ticketing technologies. Online platforms and mobile
apps offer users a seamless and convenient ticket booking
experience.
7. Infrastructure Development: To accommodate the large
number of spectators, host cities continually invest in improving and
expanding their stadium infrastructure. This includes stadium
renovations, capacity enhancements, and overall facilities
improvement.
8. Social Media Engagement: Ticket booking for IPL matches
generates significant social media engagement. Fans share their
excitement about attending matches, leading to increased online
conversations and trending topics related to IPL.
9. Cultural Impact: The IPL has become an integral part of India's
cricketing culture. Attending IPL matches fosters a sense of
community and camaraderie among fans who come together to
support their favorite teams.
10. Entertainment Industry: IPL matches are not just about
cricket; they are also a form of entertainment. Ticket booking
enables fans to experience live music performances, celebrity
appearances, and other engaging activities organized during match
intervals.
11. Charity Initiatives: IPL franchises often support charitable
causes, and part of the ticket sales revenue goes toward these
initiatives. Attending matches allows fans to contribute indirectly to
social welfare programs.
12. Global Viewership: Even for fans who cannot attend
matches in person, the process of ticket booking still holds
significance.
HARDWARE AND
SOFTWARE
REQUIREMENT
HARDWARE REQUIRMENTS:
● OPERATING SYSTEMS: WINDOWS 11
● PROCESSOR:
● MOTHER BOARD
● RAM: 512MB+
● PENDRIVE
● FLOPPYDRIVE
● MONITOR
● KEYBOARD & MOUSE
● PRINTER
SOFTWARE REQUIRMENTS:
● Windows Operating System
● Python (Script mode)
Before going to main
program
SOURCE CODE:
-- Create the 'stadiums' table
CREATE TABLE stadiums (
stadium_id INT PRIMARY KEY AUTO_INCREMENT,
stadium_name VARCHAR(100) NOT NULL,
ticket_price DECIMAL(8, 2) NOT NULL
);
-- Create the 'matches' table
CREATE TABLE matches (
match_id INT PRIMARY KEY AUTO_INCREMENT,
stadium_id INT NOT NULL,
match_name VARCHAR(100) NOT NULL,
match_time TIME NOT NULL,
FOREIGN KEY (stadium_id) REFERENCES stadiums
(stadium_id)
);
-- Create the 'seats' table
CREATE TABLE seats (
seat_id INT PRIMARY KEY AUTO_INCREMENT,
match_id INT NOT NULL,
seat_number VARCHAR(5) NOT NULL,
FOREIGN KEY (match_id) REFERENCES matches (match_id)
);
-- Create the 'users' table
CREATE TABLE users (
user_id INT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(100) NOT NULL,
otp VARCHAR(6) NOT NULL,
otp_verified BOOLEAN NOT NULL DEFAULT FALSE
);
-- Create the 'bookings' table
CREATE TABLE bookings (
booking_id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
match_id INT NOT NULL,
seat_id INT NOT NULL,
num_tickets INT NOT NULL,
snacks VARCHAR(200),
total_price DECIMAL(8, 2) NOT NULL,
booking_time TIMESTAMP NOT NULL DEFAULT
CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users (user_id),
FOREIGN KEY (match_id) REFERENCES matches (match_id),
FOREIGN KEY (seat_id) REFERENCES seats (seat_id)
MAIN PROGRAM
import smtplib
from [Link] import MIMEText
from [Link] import MIMEMultipart
import getpass
import random
# Dummy data for stadiums and matches with timings and
seat numbers
stadiums = {
"Chinnaswamy": {
"matches": [
("CSK vs RCB", "14:30", ["A1", "A2", "B1", "B2", "C1",
"C2"] ("MI vs RCB", "19:00", ["A1", "A2", "B1", "B2", "C1",
"C2"])
],
"ticket_price": 500
},
"[Link]": {
"matches": [
("CSK vs MI", "14:00", ["A1", "A2", "B1", "B2", "C1",
"C2"]), ],
"C2"])
("GT vs CSK", "19:30", ["A1", "A2", "B1", "B2", "C1",
"ticket_price": 400
},
"Wankhede": {
"matches": [
("MI vs RR", "15:00", ["A1", "A2", "B1", "B2", "C1",
"C2"]),
("MI vs LSG", "19:00", ["A1", "A2", "B1", "B2", "C1",
"C2"])
],
"ticket_price": 550
},
"Sawai Mansingh": {
"matches": [
("RR vs DC", "16:00", ["A1", "A2", "B1", "B2", "C1",
"C2"]),
("SRH vs RR", "20:00", ["A1", "A2", "B1", "B2", "C1",
"C2"])
],
"ticket_price": 450
}
}
# Function to send an email
def send_email(email, subject, body):
sender_email = "schoolproject662@[Link]"
sender_password = "nlexllznzxxtlqyw"
message = MIMEMultipart()
message["From"] = sender_email
message["To"] = email
message["Subject"] = subject
[Link](MIMEText(body, "plain"))
with [Link]("[Link]", 587) as server:
[Link]()
[Link](sender_email, sender_password)
[Link](sender_email, email,
message.as_string())
def get_user_input(prompt):
while True:
user_input = input(prompt)
if user_input:
return user_input
else:
print("Input cannot be blank. Please try again.")
def generate_otp():
# Generate a 6-digit random OTP
return str([Link](100000, 999999))
def send_otp_email(email, otp):
sender_email = "schoolproject662@[Link]"
sender_password = "nlexllznzxxtlqyw"
message = MIMEMultipart()
message["From"] = sender_email
message["To"] = email
message["Subject"] = "OTP for IPL Ticket Booking"
body = f"Your OTP for IPL Ticket Booking is: {otp}"
[Link](MIMEText(body, "plain"))
with [Link]("[Link]", 587) as server:
[Link]()
[Link](sender_email, sender_password)
[Link](sender_email, email,
message.as_string())
def verify_otp(expected_otp):
while True:
user_otp = get_user_input("Enter the OTP received in
your email: ")
if user_otp == expected_otp:
return True
else:
print("Incorrect OTP. Please try again.")
def main():
print("*******************************************")
print("Welcome to [Link] IPL Ticket Booking!")
print("*******************************************")
email = get_user_input("Enter your email ID: ")
password = [Link]("Enter your password: ")
# Simple password validation
if len(password) < 6:
print("Error: Password must be at least 6 characters
long.")
return
# Generate and send OTP
otp = generate_otp()
send_otp_email(email, otp)
print("An OTP has been sent to your email. Please check
your inbox.")
# Verify OTP
if not verify_otp(otp):
print("OTP verification failed. Booking canceled.")
return
stadium_names = list([Link]())
print("\nAvailable Stadiums:")
for i, stadium in enumerate(stadium_names, 1):
print(f"{i}. {stadium}")
while True:
selected_stadium_index = get_user_input("Select a
stadium (enter the index): ")
if not selected_stadium_index.isdigit() or
int(selected_stadium_index) not in range(1,
len(stadium_names) + 1):
print("Error: Invalid stadium selection. Please try
again.")
else:
selected_stadium =
stadium_names[int(selected_stadium_index) - 1]
break
stadium_details = stadiums[selected_stadium]
matches = stadium_details["matches"]
ticket_price = stadium_details["ticket_price"]
print(f"\nMatches at {selected_stadium}:")
for i, match_info in enumerate(matches, 1):
match_name, match_time, seat_numbers = match_info
print(f"{i}. {match_name} Time: {match_time}")
while True:
selected_match_index = get_user_input("Select a match
(enter the index): ")
if not selected_match_index.isdigit() or
int(selected_match_index) not in range(1, len(matches) + 1):
print("Error: Invalid match selection. Please try
again.")
else:
selected_match, selected_match_time, seat_numbers
= matches[int(selected_match_index) - 1]
break
print(f"\nAvailable Seats for {selected_match}:")
for seat in seat_numbers:
print(seat)
while True:
selected_seat = get_user_input("Select a seat (enter the
seat number): ")
if selected_seat not in seat_numbers:
print("Error: Invalid seat selection. Please try again.")
else:
break
while True:
try:
num_tickets = int(get_user_input("Enter the number
of tickets you want to book: "))
if num_tickets < 1:
print("Error: You must book at least one ticket.
Please try again.")
else:
break
except ValueError:
print("Error: Invalid input. Please enter a number.")
# Calculate total price
total_price = ticket_price * num_tickets
snacks_menu = {
"Popcorn": 150,
"Hot Dog": 120,
"Burger": 180,
"Nachos": 130
}
print("\nAvailable Snacks:")
for i, (snack, price) in enumerate(snacks_menu.items(), 1):
print(f"{i}. {snack} - Rs{price}")
selected_snacks = []
while True:
snack_choice = get_user_input("Select a snack (enter the
index or 'done' to skip): ")
if snack_choice.lower() == 'done':
break
elif not snack_choice.isdigit() or int(snack_choice) not in
range(1, len(snacks_menu) + 1):
print("Error: Invalid snack selection. Please try again.")
else:
selected_snack =
list(snacks_menu.keys())[int(snack_choice) - 1]
selected_snacks.append(selected_snack)
print("\nSelected Snacks:")
if selected_snacks:
for snack in selected_snacks:
print(snack)
else:
print("None")
# Calculate snacks total price
snacks_total_price = sum(snacks_menu[snack] for snack in
selected_snacks)
print("\nSummary:")
print(f"Stadium: {selected_stadium}")
print(f"Match: {selected_match}")
print(f"Time: {selected_match_time}")
print(f"Seat Number: {selected_seat}")
print(f"Number of tickets: {num_tickets}")
print(f"Ticket Price: {ticket_price}")
print(f"Snacks: {', '.join(selected_snacks) if selected_snacks
else 'None'}")
print(f"Snacks Total Price: {snacks_total_price}")
print(f"Total Price: {total_price + snacks_total_price}")
confirmation = get_user_input("\nConfirm your booking
(yes/no): ")
if [Link]() == "yes":
print("**********************************")
print("Booking Successful! Enjoy the match!")
print("**********************************")
# Send confirmation email
subject = f"IPL Ticket Booking Confirmation -
{selected_stadium}"
body = f"Dear Customer,\n\nThank you for booking IPL
tickets.\n\nStadium: {selected_stadium}\nMatch:
{selected_match}\nTime: {selected_match_time}\nSeat
Number: {selected_seat}\nNumber of Tickets:
{num_tickets}\nTicket Price: {ticket_price}\nSnacks: {',
'.join(selected_snacks) if selected_snacks else
'None'}\nSnacks Total Price: {snacks_total_price}\nTotal
Price: {total_price + snacks_total_price}\n\nEnjoy the
match!"
send_email(email, subject, body)
else:
print("Booking Canceled. Thank you!")
if name == " main ":
main()
OUTPUT
STEP 1
STEP 2
STEP 3
STEP 4
STEP 5 :
STEP 6 :
STEP 7 :
STEP 8 :
STEP 9 :
STEP 10 :
CONCLUSION
1. User Registration and Authentication: Users are
required to provide their email ID and password to proceed with the
booking. An OTP (One-Time Password) is sent to the user's email for
verification, ensuring a secure and valid user authentication process.
2. Stadium and Match Selection: Users can view a list of
available stadiums and matches. They can select their preferred
stadium and match from the provided options.
3. Seat Selection: After selecting a match, users can choose their
desired seat from the available seat numbers for that specific match
4. Ticket Price Calculation: The script calculates the total
price based on the selected number of tickets and the ticket price for
the chosen stadium.
5. Snacks Selection (Optional): Users have the option to
add snacks to their booking. A menu of available snacks with their
respective prices is displayed to the user.
6. Booking Confirmation: The system displays a summary of
the user's booking, including the stadium, match, seat, number of
tickets, ticket price, selected snacks (if any), and the total price. Users
must confirm their booking to proceed.
7. Email Confirmation: After successful booking confirmation,
an email is sent to the user's provided email address, containing all
the booking details for their reference.
BIBLIOGRAPHY
[Link]
-davinci-002-render-sha
[Link]
[Link]
ch?wallpaper=python
[Link]
box