0% found this document useful (0 votes)
26 views75 pages

Lakshya IP (1)

The document outlines a project report for a quiz game developed using Python, submitted by Lakshya Lalwany under the guidance of Mrs. Priyanka Dwivedi at Vichakshan Jain Vidyapeeth. It includes acknowledgments, objectives, theoretical background on databases and programming languages, problem definition, and system design. The project aims to create an online examination system that is user-friendly and efficient, automating traditional manual processes.

Uploaded by

adarsh24jdp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views75 pages

Lakshya IP (1)

The document outlines a project report for a quiz game developed using Python, submitted by Lakshya Lalwany under the guidance of Mrs. Priyanka Dwivedi at Vichakshan Jain Vidyapeeth. It includes acknowledgments, objectives, theoretical background on databases and programming languages, problem definition, and system design. The project aims to create an online examination system that is user-friendly and efficient, automating traditional manual processes.

Uploaded by

adarsh24jdp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 75

VICHAKSHAN JAIN VIDYAPEETH

KUMHARI, DURG
SESSION: 2024-25

IP PROJECT ON
QUIZ GAME

SUBMITTED TO: SUBMITTED BY:


Mrs. PRIYANKA DWIVEDI LAKSHYA LALWANY
PGT (COMPUTER) XII COMMERCE
ACKNOWLEDGEMENT

I would like to thank the Principal,


Mr. Sanjay Mishra of Vichakshan Jain Vidyapeeth
for his encouragement and for providing all the
necessary facilities for this project work. He has been
kind enough to allow me to execute this project work
under his guidance, which has been truly invaluable
throughout this endeavor.

I take this opportunity to thank


Mrs. Priyanka Dwivedi, my Computer teacher, who
guided me all through with great value and
encouraging words, besides giving constructive
criticism. Her motivational attitude has significantly
contributed to the successful completion of this
project.

LAKSHYA LALWANY
XII COMMERCE
CERTIFICATE

This is to certify that LAKSHYA LALWANY of Class


XII COMMERCE, has prepared the report on the
project entitled
‘IP PROJECT ON QUIZ GAME’
project Under my supervision.

He has taken proper care, shown sincerity in the


completion of this project.
The project is found worthy of acceptance as final
project for Information Practices.

SIGNATURE OF SIGNATURE OF
INTERNAL EXTERNAL

SIGNATURE OF
PRINCIPAL
CONTENTS

1. Introduction
2. Objective & Scope of the Project
3. Theoretical Background
4. Problem Definition & Analysis
5. System Implementation
1 - The Hardware used
2 - The Software used
6. System Design & Development
1 - Database Design
2 - Source Code
7. User Manual
1 - How to install Software
2 - Working with Software
8. Reference
1. INTRODUCTION :-
We had made a fun Quiz game using python. In this
game when we will run the program a question will
be asked to the user that if he/she wants to play the
game or not.

If he/she choose to play, the question will be


shown in the screen. The question will be of M.C.Q.
type there will be three or four options. If user
chooses the correct option, then user’s score will be
shown and updated after every question time to time.

There will be total of 10 questions of 1 marks


each (10 marks). This quiz will be easy as well as it
will help to gain some knowledge. The software we
have used to make this project is python 3.10.64.

When we were making this project we took help from


our PGT (Computer) teacher
Mrs. Priyanka Dwivedi.
2. OBJECTIVES & SCOPES :-
1.) Objectives :-
The main objective of Quiz System Project is to
facilitate a user friendly environment of Blue book
implementation and reduces the manual effort.
Providing an online comprehensive solution to
manage quiz system where the individuals are
participating in a team. The purpose of the system is
to develop Online Examination System. Online
Examination System is used to test the Domain
knowledge of the students, and employees with
respect to the particular technology. The manual
procedure used for conducting exam is time
consuming process and error prone due to human
limitations. The System purpose is to completely
automate the old manual procedure of conducting
exam to Online Web Based Examination System.

2.) Scopes :-
It saves more time.
It saves the student's money.
It saves paper.
It's more secure.
It also helps to make India one step forward in
Technology.
3. THEORETICAL BACKGROUND :-
1.) What is Database?
1.1) Introduction and Concepts :-
A Database is a collection of information related
to a particular subject or purpose, such as tracking
customer orders or maintaining a music collection.
Using any RDBMS application software like MS
SQL Server, MySQL, Oracle, Sybase, etc. You can
manage all your information from a single database
file.

Within the file, divide your data into separate


storage containers called Tables. You may and
retrieve the data using queries.

A Table is a collection of data about a specific


topic, such as products or suppliers. Using a separate
table for each topic means you can store that data
only once, which makes your database more efficient
and reduces data-entry errors. Table organizes data
into columns (called fields) and rows (called records).
A Primary Key is one or more fields whose
value or values uniquely identify each record in a
table. In a relationship, a primary key is used to refer
to specific record in one table from another table.

A Primary Key is called Foreign Key when it


is referred to from another table.

To find and retrieve just the data that meets


conditions you specify, including data from multiple
tables, create a Query. A Query can also update or
delete multiple records at the same time, and perform
built-in or custom calculations on your data.
1.2) Role of RDBMS Application Program :-
--------A computer database works as a electronic
filing system, which has a large number of ways of
cross-referencing, and this allows the user many
different ways in which to re-organize and retrieve
data.

--------A database can handle business inventory,


accounting and filing and use the information in its
files to prepare summaries, estimates and other
reports. The management of data in a database
system is done by means of a general-purpose
software package called a Database Management
System (DBMS).

Some commercially available DBMS are MS


SQL Server, MS ACCESS, INGRES, ORACLE,
and Sybase. A database management system,
therefore, is a combination of hardware and software
that can be used to set up and monitor a database,
and can manage the updating and retrieval of
database that has been stored in it.
Most of the database management systems have the
following capabilities:

Creating of a table, addition, deletion,


modification of records.
Retrieving data collectively or selectively.
The data stored can be sorted or indexed at the
user's discretion and direction.
Various reports can be produced from the
system. These may be either standardized report
or that may be specifically generated according
to specific user definition.
Mathematical functions can be performed and
the data stored in the database can be
manipulated with these functions to perform the
desired calculations.
To maintain data integrity and database use.
2.) What is MySQL ?
The management of data in a database system
is done by means of a general-purpose software
package called a Database Management System
(DBMS). Some commercially available RDBMS are
MS SQL Server, MS ACCESS, INGRES,
ORACLE, and Sybase.

MySQL, the most popular Open Source SQL


database management system, is developed,
distributed, and supported by Oracle Corporation.

Its name is a combination of "My", the name


of co-founder Michael Widenius's daughter My and
"SQL", the acronym for Structured Query Language.

2.1) MySQL is a database management system :-


A database is a structured collection of data.
It may be anything from a simple shopping list to a
picture gallery or the vast amounts of information in
a corporate network. To add, access, and process
data stored in a computer database, you need a
database management system such as MySQL
Server. Since computers are very good at handling
large amounts of data, database management
systems play a central role in computing, as
standalone utilities, or as parts of other applications.
2.2) MySQL databases are relational :-
A relational database stores data in separate
tables rather than putting all the data in one big
storeroom. The database structures are organized
into physical files optimized for speed. The logical
model, with objects such as databases, tables, views,
rows, and columns, offers a flexible programming
environment. You set up rules governing the
relationships between different data fields, such as
one-to-one, one-to-many, unique, required or
optional, and “pointers” between different tables.
The database enforces these rules, so that with a
well-designed database, your application never sees
inconsistent, duplicate, orphan, out-of-date, or
missing data.

----------The SQL part of “MySQL” stands for


“Structured Query Language”. SQL is the most
common standardized language used to access
databases. Depending on your programming
environment, you might enter SQL directly (for
example, to generate reports), embed SQL
statements into code written in another language, or
use a language-specific API that hides the SQL
syntax.
--------SQL is defined by the ANSI/ISO SQL
Standard. The SQL standard has been evolving since
1986 and several versions exist. In this manual,
“SQL-92” refers to the standard released in 1992,
“SQL:1999” refers to the standard released in 1999,
and “SQL:2003” refers to the current version of the
standard. We use the phrase “the SQL standard” to
mean the current version of the SQL Standard at any
time.

2.3) MySQL software is Open Source:-


-----Open Source means that it is possible for
anyone to use and modify the software. Anybody
can download the MySQL software from the
Internet and use it without paying anything. If you
wish, you may study the source code and change it to
suit your needs. The MySQL software uses the GPL
(GNU General Public License), to define what you
may and may not do with the software in different
situations.
2.4) The MySQL Database Server is very fast,
b reliable, scalable, and easy to use:-
-----------If that is what you are looking for, you
should give it a try. MySQL Server can run
comfortably on a desktop or laptop, alongside your
other applications, web servers, and so on, requiring
little or no attention.
-----------If you dedicate an entire machine to
MySQL, you can adjust the settings to take
advantage of all the memory, CPU power, and I/O
capacity available. MySQL can also scale up to
clusters of machines, networked together.

MySQL Server was originally developed to


handle large databases much faster than existing
solutions and has been successfully used in highly
demanding production environments for several
years. Although under constant development,
MySQL Server today offers a rich and useful set of
functions. Its connectivity, speed, and security make
MySQL Server highly suited for accessing databases
on the Internet.

2.5) MySQL Server works in client/server or


k embedded systems :-
-----------The MySQL Database Software is a
client/server system that consists of a multithreaded
SQL server that supports different back ends, several
different client programs and libraries,
administrative tools, and a wide range of application
programming interfaces (APIs). Highly suited for
accessing databases on the Internet.
2.6) The Main Features of MySQL :-
Written in C and C++.
Works on many different platforms.
Uses multi-layered server design with
independent modules.
Provides transactional and nontransactional
storage engines.
Designed to make it relatively easy to add other
storage engines. This is useful if you want to
provide an SQL interface for an in-house
database.
Uses a very fast thread-based memory allocation
system.
Executes very fast joins using an optimized
nested-loop join.
Implements SQL functions using a highly
optimized class library that should be as fast as
possible. Usually there is no memory allocation
at all after query initialization.
Provides the server as a separate program for use
in a client/server networked environment, and as
a library that can be embedded (linked) into
stand alone applications. Such applications can
be used in isolation or in environments where no
network is available.
Password security by encryption of all password
traffic when you connect to a server.
Support for large databases.
3.) What is Python ?
------------Python is an interpreted, object-oriented,
high-level programming language with dynamic
semantics. Its high level built in data structures,
combined with dynamic typing and dynamic binding,
make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue
language to connect existing components together.

-------Python's simple, easy to learn syntax


emphasizes readability and therefore reduces the cost
of program maintenance. Python supports modules
and packages, which encourages program
modularity and code reuse. The Python interpreter
and the extensive standard library are available in
source or binary form without charge for all major
platforms, and can be freely distributed.

------------Often, programmers fall in love with


Python because of the increased productivity it
provides. Since there is no compilation step, the edit-
test-debug cycle is incredibly fast. Debugging Python
programs is easy: a bug or bad input will never cause
a segmentation fault. Instead, when the interpreter
discovers an error, it raises an exception. When the
program doesn't catch the exception, the interpreter
prints a stack trace.
A source level debugger allows inspection of
local and global variables, evaluation of arbitrary
expressions, setting breakpoints, stepping through
the code a line at a time, and so on. The debugger is
written in Python itself, testifying to Python's
introspective power. On the other hand, often the
quickest way to debug a program is to add a few
print statements to the source: the fast edit test-
debug cycle makes this simple approach very
effective.

3.1) Features of Python :-


------------Python provides many useful features
which make it popular and valuable from the other
programming languages. It supports object-oriented
programming, procedural programming approaches
and provides dynamic memory allocation. We have
listed below a few essential features:
Easy to Learn and Use:- Python is easy to learn
as compared to other programming languages.
Its syntax is straightforward and much the same
as the English language. There is no use of the
semicolon or curly-bracket, the indentation
defines the code block. It is the recommended
programming language for beginners.
Expressive Language:- Python can perform
complex tasks using a few lines of code. A simple
example, the hello world program you simply
type ‘Print("Hello World")’. It will take only one
line to execute, while Java or C takes multiple
lines.
Free and Open Source:- Python is freely available
for everyone. It is freely available on its official
website www.python.org. It has a large
community across the world that is dedicatedly
working towards make new python modules and
functions. Anyone can contribute to the Python
community. The open-source means, “Anyone
can download its source code without paying
any penny.”
Large Standard Library:- It provides a vast range
of libraries for the various fields such as machine
learning, web developer, and also for the
scripting. There are various machine learning
libraries, such as Tensor flow, Pandas, Numpy,
Keras, and Pytorch, etc. Django, flask, pyramids
are the popular framework for Python web
development.
Integrated:- It can be easily integrated with
languages like C, C++, and JAVA, etc. Python
runs code line by line like C,C++ Java. It makes
easy to debug the code.
Cross-platform Language:- Python can run
equally on different platforms such as Windows,
Linux, UNIX, and Macintosh, etc. So, we can
say that Python is a portable language. It enables
programmers to develop the software for several
competing platforms by writing a program only
once.
4. PROBLEM DEFINITION
& ANALYSIS :-
The hardest part of building a software system is
deciding precisely what to build. No other part
of the conceptual work is as difficult as
establishing the detailed technical requirement.
Defining and applying good, complete
requirements are hard to work, and success in
this endeavor has eluded all of us. Yet, we
continue to make progress.

Problem definition describes the what of a


system, not how. The quality of a software
product is only as good as the process that
creates it. Problem definition is one of the most
crucial steps in this creation process. Without
defining a problem, developers do not know
what to build, customers do not know what to
expect, and there is no way to validate that the
built system satisfies the requirement.
Problem definition and Analysis is the activity
that encompasses learning about the problem to
be solved, understanding the needs of customer
and users, trying to find out who the user really
is, and understanding all the constraints on the
solution.

It includes all activities related to the following:-


Identification and documentation of customer’s
or user’s needs.
Creation of a document that describes the
external behavior and the association
constraints that will satisfies those needs.
Analysis and validation of the requirements
documents to ensure consistency, completeness,
and feasibility.
Evolution of needs.

After the analysis of the functioning of a Quiz


Game, the proposed System is expected to do the
following:-
The System should ask the name and should
display at the last.
The program should ask for one of the four
categories (Bollywood, Animals, Literature &
Current Affairs) and ask the questions as such
category selected.
5. SYSTEM IMPLEMENTATION :-
1.) The Hardware Used :-
While developing the system, the used hardware are:-
PC with Pentium IV processor or sometimes, PC
with Celeron (1.7 GHz) processor having 256
MB RAM.
SVGA.
other required devices.

2.) The Software used :-


Microsoft Windows® 10 as Operating System.
Python IDLE 3.10 as Front-end Development
environment.
MySQL as Back-end Sever with Database for
Testing.
Canva or MS-Word 2000 for documentation.
6. SYSTEM DESIGN &
DEVELOPMENT :-
1.) Database Design :-
1.1) Login Code :-
ac="Welcome to the Quiz Game!"
print(ac.center(80))
v=input("Enter Your Name:- ")
1.2) Quiz Game:-
1.) Category = Bollywood
2.) Category = Literature
3.) Category = Animals
4.) Category = Current Affairs
1.3) MySQL :-
Create database Lakshya;
Use Lakshya;
Create table Project(Name varchar(255), Score int);
2.) Source Code :-
#This game ask multiple choice question.
#The game will also keep track of the score and it is
going to print it at the end.

#IMPORTING MODULES
from colorama import init, Fore, Back, Style
init()
import time
import tkinter as tk
#Welcome the user
ac="Welcome to the Quiz Game!"
print(ac.center(80))
v=input("Enter Your Name:-")
time.sleep(0.50)
print(1)Select the category in which you want to
answer questions",v,"\n(1) Entertainment\n(2)
Literature\n(3) Animals\n(4) Current Affairs\n\n ")
i=int(input("Enter Your Category 1,2,3,4:-"))
time.sleep(0.50)

#Chances
chances = 1
print("\nThere will be 10 questions.\nYou will be
given", chances, "point to answer 1 question
correctly. \nPlease put the alphabet of the answer.")
#Score
time.sleep(1.50)
print("\n\nLet's start the Quiz!")
score = 0
def bollywood():
#question number 1
global score
question_1 = print("1)As of 2020, which is the only
Bollywood movie to win 13 Filmfare Awards?\n(a)
Article 15\n(b) Uri: The Surgical Strike\n(c) Saand
Ki Aankh\n(d) Gully Boy\n\n TYPE quit TO QUIT
THE QUIZ\n\n\n")
answer_1 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_1):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_1,
"\n\n")
time.sleep(0.50)
#question number 2
question_2 = print("2) Which Bollywood
personality was named by NITI Aayog to promote
the Women Entrepreneurship platform (WEP)?\n(a)
Salman Khan\n(b) Akshay Kumar\n(c) Sushant
Singh Rajput\n(d) Vidya Balan\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_2 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_2):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_2,
"\n\n")
time.sleep(0.25)
#question number 3
question_3 = print("3) Bahubali festival is releted
to:-\n(a) Jainism\n(b) Hinduism\n(c) Buddhism\n(d)
Islam \n\n TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_3 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_3):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_3,
"\n\n")
time.sleep(0.25)
#question number 4
question_4 = print("4) Which Bollywood
personality has launched an online platform called
Pravasi Rojgar to help migrants find job
opportunities?\n(a) Nana Patekar\n(b) Nawazuddin
Siddiqui\n(c) Sonu Sood\n(d) Amitabh Bachchan\n\n
TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_4 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if(answer.lower() == answer_4):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_4,
"\n\n")
time.sleep(0.25)
#question number 5
question_5 = print("5) Which Bollywood celebrity
has been appointed as the first ever brand
ambassador of IDFC FIRST Bank?\n(a) Amitabh
Bachchan\n(b) Ranveer Singh\n(c) Salman
Khan\n(d) Shah Rukh Khan\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_5 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_5):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_5,
"\n\n")
time.sleep(0.25)
#question number 6
question_6 = print("6) Which movie has become
the first Bollywood film to go plastic-free?\n(a)
War\n(b) Mission Mangal\n(c) Coolie No. 1\n(d)
Dream Girl\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_6 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_6):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_6,
"\n\n")
time.sleep(0.25)
#question number 7
question_7 = print("7) Which Bollywood
personality has been honoured with the Meryl Streep
Award for Excellence?\n(a) Vidya Balan\n(b)
Aishwarya Rai Bachchan\n(c) Deepika
Padukone\n(d) Madhuri Dixit\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_7 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_7):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_7,
"\n\n")
time.sleep(0.25)
#question number 8
question_8 = print("8) Which Bollywood
personality has been named advocacy-
ambassador for Swachh Aadat Swachh Bharat
initiative?\n(a) Amitabh Bachchan\n(b) Aamir
Khan\n(c) Priyanka Chopra\n(d) Kajol\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_8 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_8):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_8,
"\n\n")
time.sleep(0.25)
#question number 9
question_9 = print("9) Which of the following
movies has became the first Bollywood film ever to
release in Saudi Arabia?\n(a) Pad manr\n(b)
Gold\n(c) Parmanu\n(d) Raazi\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_9 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_9):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_9,
"\n\n")
time.sleep(0.25)
#question number 10
question_10 = print("10) The Versatile Bollywood
actor Irrfan Khan, who recently passed away, had
won National award for which movie?\n(a) Lunch
Box \n(b) Life of Pi\n(c) Paan Singh Tomar\n(d)
Haidar\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_10 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_10):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_10,
"\n\n")
time.sleep(1)
if i==1:

bollywood()
def Literature():
#question number 1
global score
question_1 = print("1) Which American writer
published 'A brave and startling truth'in 1996?\n(a)
Robert Hass\n(b) Maya Angelou\n(c) Jessica
Hagdorn\n(d) Micheal Palmer\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_1 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_1):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_1,
"\n\n")
time.sleep(2)
#question number 2
question_2 = print("2) who is the writer of
endymion?\n(a) Fanny Brawne\n(b) William
Wordsworth\n(c) Jhon Keats\n(d) Lord Byron\n\n
TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_2 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_2):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_2,
"\n\n")
time.sleep(2)
#question number 3
question_3 = print("3) Which poet is considered a
national hero in Greece?\n(a) Lord Byron\n(b) John
keats\n(c) Solan\n(d) Sappho\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_3 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_3):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_3,
"\n\n")
time.sleep(2)
#question number 4
question_4 = print("4) What was strange about
Emily Dickson?\n(a) She wrote her poems in
invisible ink\n(b) She never attempted to publesh her
poetry\n(c) She rarely left home\n(d) She wrote in
code\n\n TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_4 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_4):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_4,
"\n\n")
time.sleep(2)
#question number 5
question_5 = print("5) The repetition of similar
ending sounds are called ______?\n(a)
alliteration\n(b) onomatopeia\n(c) rhyme\n(d) None
of these\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_5 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_5):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_5,
"\n\n")
time.sleep(2)
#question number 6
question_6 = print("6) The repetition of beginning
consonant sounds are called ______?\n(a) rhyme\n(b)
alliteration\n(c) onomatopoeia\n(d) NONE OF THE
ABOVE\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_6 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_6):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_6,
"\n\n")
time.sleep(2)
#question number 7
question_7 = print("7) A poem that tells a story
with plot,setting,and characters are called ______?
\n(a) lyric\n(b) free verse\n(c) narrative\n(d) None of
the above\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_7 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_7):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_7,
"\n\n")
time.sleep(2)
#question number 8
question_8 = print("8) William Shespear was born
in the year:-\n(a) 1544 \n(b) 1578\n(c) 1582\n(d)
1564\n\n TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_8 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_8):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_8,
"\n\n")
time.sleep(2)
#question number 9
question_9 = print("9) Which is an exaggeration?
\n(a) Hyperbole\n(b) Haiku\n(c) Alliteration\n(d)
Prose\n\n TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_9 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_9):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_9,
"\n\n")
time.sleep(2)
#question number 10
question_10 = print("10) Shakespeare
wrote_____plays?\n(a) 32\n(b) 34\n(c) 38\n(d) 36\n\n
TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_10 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_10):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_10,
"\n\n")
time.sleep(1)
if i==2:

Literature()
def Animals():
#question number 1
global score
question_1 = print("1)Which of the following is
not a true snake?\n(a) Tree Snake\n(b) Glass
Sanke\n(c) Blind Snake\n(d) Sea Snake\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_1 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_1):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_1,
"\n\n")
time.sleep(2)
#question number 2
question_2 = print("2) which is the largest living
animal?\n(a) whale\n(b) Elephant\n(c) Rorqual\n(d)
None of these\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_2 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_2):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_2,
"\n\n")
time.sleep(2)
#question number 3
question_3 = print("3) Which is the smallest bird
alive?\n(a) Budgerigar\n(b) Canary\n(c) Finch\n(d)
Hummingbird\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_3 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_3):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_3,
"\n\n")
time.sleep(2)
#question number 4
question_4 = print("4) Which is the fastest land
animal?\n(a) fox\n(b) Cheetah\n(c) Dog\n(d) None of
the above\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_4 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_4):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_4,
"\n\n")
time.sleep(2)
#question number 5
question_5 = print("5) Which is the largest land
animal?\n(a) African bush elephant\n(b) Blue
Whale\n(c) Elephant\n(d) None of these\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_5 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_5):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_5,
"\n\n")
time.sleep(2)
#question number 6
question_6 = print("6) The world's heaviest flying
bird is the?\n(a) Swift\n(b) Hen\n(c) Great
Bustard\n(d) Griffon Vulture\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_6 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_6):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_6,
"\n\n")
time.sleep(2)
#question number 7
question_7 = print("7) What is the smallest breed
of dog in the world?\n(a) Terrier\n(b) Pug\n(c)
Chihuahua\n(d) None of the above\n\n TYPE quit
TO QUIT THE QUIZ\n\n\n")
answer_7 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_7):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_7,
"\n\n")
time.sleep(2)
#question number 8
question_8 = print("8) Patanwadi,a sheep breed
known for its hosiery wool quality,is native to?\n(a)
Maharashtra\n(b)
Kerala\n(c) Assam\n(d) Gujarat\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_8 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_8):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_8,
"\n\n")
time.sleep(2)
#question number 9
question_9 = print("9) The rearing of silkworms
for obtaining silk is knowm as?\n(a) Apiculture\n(b)
Horticulture\n(c) Sericulture\n(d) Silviculture\n\n
TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_9 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_9):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_9,
"\n\n")
time.sleep(2)
#question number 10
question_10 = print("10) In rural area cow dung is
used to coat the floor and wall to?\n(a) make them
smooth\n(b) make them rough for friction\n(c) give
a natural colour to the walls and floors\n(d) keep the
insects away\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_10 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_10):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_10,
"\n\n")
time.sleep(1)
if i==3:

Animals()
def Current_Affairs():
#question number 1
global score
question_1 = print("1)What is the annual budget
for FY22-23\n(a) 347Lakh Million\n(b) 458Lakh
Million\n(c) 295Lakh Million\n(d) 426Lakh
Million\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_1 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_1):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_1,
"\n\n")
time.sleep(2)
#question number 2
question_2 = print("2) Which Ministry has
amended the rules pertaining to location of thermal
power plants near cities and national capital region?
\n(a) Ministry of Home Affairs\n(b) Ministry of
Power\n(c) Ministry of Environment, Forest and
Climate Change\n(d) Ministry of New and
Renewable Energy\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_2 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_2):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_2,
"\n\n")
time.sleep(2)
#question number 3
question_3 = print("3) Which body permits
Telecommunication companies to conduct trials for
5G technology in India?\n(a) NITI Aayog\n(b)
Department of Telecommunications\n(c) TRAI\n(d)
Department of Science and Technology\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_3 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_3):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_3,
"\n\n")
time.sleep(2)
#question number 4
question_4 = print("4) Which country has
approved a grant of ₹265 crore for improving the
power supply of Andaman & Nicobar Islands?\n(a)
USA\n(b) Russia\n(c) Japan\n(d) China\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_4 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_4):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_4,
"\n\n")
time.sleep(2)
#question number 5
question_5 = print("5) Which State has announced
the creation of four new districts?\n(a) West
Bengal\n(b) Jharkhand\n(c) Telangana\n(d)
Chhattisgarh\n\n TYPE quit TO QUIT THE
QUIZ\n\n\n")
answer_5 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_5):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_5,
"\n\n")
time.sleep(2)
#question number 6
question_6 = print("6) Which hospital has become
the first hospital in the country to house a fire station
in its campus?\n(a) Tata Memorial Hospital,
Mumbai\n(b) AIIMS Delhi\n(c) NIMHANS,
Bengaluru\n(d) Lilavati Hospital, Mumbai\n\n
TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_6 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_6):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_6,
"\n\n")
time.sleep(2)
#question number 7
question_7 = print("7)Edayur and Kuttiattoor,
which were in news recently, belongs to which state?
\n(a) Andhra Pradesh\n(b) Kerala\n(c)
Karnataka\n(d) Tamil Nadu\n\n TYPE quit TO
QUIT THE QUIZ\n\n\n")
answer_7 = "b"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_7):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_7,
"\n\n")
time.sleep(2)
#question number 8
question_8 = print("8) Which state has
commenced a campaign named “10-day ‘All Mask’”
campaign??\n(a)Mizoram\n(b) Tamil Nadu\n(c)
Maharastra\n(d) Kerala\n\n TYPE quit
TO QUIT THE QUIZ\n\n\n")
answer_8 = "a"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_8):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_8,
"\n\n")
time.sleep(2)
#question number 9
question_9 = print("9) Which Indian state/UT is
set to launch the ‘Anti Open Burning Campaign’?
\n(a) Punjab\n(b) Haryana\n(c) Uttarpradesh\n(d)
Delhi\n\n TYPE quit TO QUIT THE QUIZ\n\n\n")
answer_9 = "d"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_9):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_9,
"\n\n")
time.sleep(2)
#question number 10
question_10 = print("10) Who is the Textile
Minister of India?\n(a) Shri Vijoy Kumar Singh\n(b)
Smt. Darshana Vikram Jardosh\n(c) Shri Piyush
Goyal\n(d) Shri Upendra Prasad Singh\n\n TYPE
quit TO QUIT THE QUIZ\n\n\n")
answer_10 = "c"
for i in range(chances):
answer = input("Answer: ")
if(answer.lower()=="quit"):
print ("BYE!!!!")
quit()
if (answer.lower() == answer_10):
print("Correct! Good Job.\n")
score = score + 1
break
else:
print("Incorrect!\n")
time.sleep(0.5)
print("The correct answer is", answer_10,
"\n\n")
time.sleep(0.50)
if i==4:

Current_Affairs()
if i>=5:
print("INSERT CORRECT CATEGORY NEXT
TIME")
time.sleep(0.50)
quit()
print(Fore.WHITE+"")
#print the score
while score >= 6:
print("Well done! Your score was", score)
break
while score <= 5:
print("Better luck next time! Your score was",
score)
break
#Goodbye message
print("Thank you for playing the Quiz Game!")
#conncting mysql
import pandas as pd
import pymysql
mydb=pymysql.connect(
host="localhost",
user="root",
password="123",
database="Lakshya")
mycursor=mydb.cursor()
m= score
q=(v,m)
s="insert into project (Name,Score) values(%s,%s)"
mycursor.execute(s,q)
mydb.commit()
cursor=mydb.cursor()
cursor.execute("select*from project")
myresult=cursor.fetchall()
a=pd.DataFrame(myresult,columns=
['Name','Score'])
print(a)
A=input("PRESS ENTER TO EXIT")
print(A)
7. USER MANUAL :-
1.) How to install Software :-
1.1) Hardware Requirement :-
PC with Intel(R) Pentium(R) processor or
similar processor based PC at Client/Server end.
2 GB RAM and 4 GB HDD space (for
Database) is desirable.
Standard I/O devices like Keyboard and Mouse
etc.
Printer is needed for hard-copy reports.
Local Area Network(LAN) is required for Client
Server Installation.
1.2) Software Requirement :-
Windows 10 OS is desirable.
Python Version 3.7 or higher should be installed.
MySQL Ver 6.1 with project data Database must
be present at machine.
2.) Working with Software :-
The software project is distributed with a backup
copy of a Database named Lakshya with required
table. Some dummy records are present in the table
for testing purposes, which can be deleted before
inserting real data. The project is shipped with
Lakshya.sql file which installs a database and tables
in the computer system.

Note: The PC must have MySQL server with user


(root) and password (123).

If root password is any other password, it can be


changed by running MySQL Server Instance
Configure Wizard.

Start 4 Program 4 MySQL 4 MySQL Server 4


MySQL Server Instance Config Wizard Provide
current password of root and new password as
“123”, this will change the root password.
To install a MySQL database from a dump file
(Lakshya.sql) , simply follow the following steps:-

Step 1: Copy the Lakshya.sql file in C:\Program


files\Mysql\MySql server 5.1\Bin folder.
Step 2: Open MySQL and type the following
command to create the database named Lakshya,
mysql> create database Lakshya;
Step 3: Open Command Window (Start 4Run 4
cmd).
Step 4: Go to the following folder using CD
command of DOS. C:\Program files\Mysql\MySql
server 5.1\Bin>
Step 5: Type the following command on above
prompt - C:….\bin> mysql -u root -p Lakshya.
8. REFERENCES :-
In order to work on this project titled– IP project on
Quiz Game, the following books and literature are
referred by me during the various phases of
development of the project:-

Informatics Practices for class XI -by Sumita


Arora.
Informatics Practices for class XII -by Sumita
Arora.
Various Websites of Discussion Forum and
software development activities:-
1. https://www.w3schools.com/python/python_fun-
ctions.asp.
2. https://dev.mysql.com/doc/connectorpython/en/-
connector-python-exampleconnecting.html.
Understanding SQL – by Gruber.
Other than the above-mentioned books, the
suggestions and supervision of my
PGT(Computer) teacher Mrs. Priyanka Dwivedi
Mam, my friends and my class experience also
helped me to develop this software project.

You might also like