KEY FEATURES
1. Uses dictionary to store quiz
data
2. Uses threading to control time
3. Automatic time-out if user
doesn’t respond
4. Beginner-friendly and basic
Python only
5. Console-based application
INTRODUCTION
A Quiz Game is a program that asks multiple-choice questions and checks the
user’s [Link] this project, Python is used to create a console-based quiz game
where:
1. Questions and answers are stored using dictionaries
2. The user has a limited time (5 seconds) to answer each question
3. The score is calculated automatically
This project uses basic Python concepts and is suitable for beginners
OBJECTIVES OF THE PROGRAME
1. To understand the use of
dictionaries in Python
2. To implement a multiple-choice
quiz
3. To add an automatic time-out
feature
4. To calculate and display the final
score
5. To improve logical and
programming skills
Table OF MODULE USED
Tool / Module Purpose
Python Programming language
Time Module Time Handling
Threading Module Control Time Out
Dictionary To Store Questions And
Answer
LOGIC / STEPS USED TO DO
1. Import required modules
2. Store questions and answers in a dictionary
3. Display questions and options
4. Start a timer for each question
5. Accept user input within time limit
5. Check answer
6. Update score
[Link] final result
EXPLANATION OF THE CODE
Importing Modules
time → used for time-related operations
threading → allows the program to take input and run a timer at
the same time
EXPLANATION OF THE CODE
Quiz Data Using Dictionary
Key → Question
Value → Another dictionary containing:
options → List of multiple-choice options
answer → Correct option
This structure makes the quiz easy to modify and
extend.
EXPLANATION OF THE CODE
Score Initialization
score → Stores correct answers count
user_answer → Stores the user’s input
EXPLANATION OF THE CODE
Function to Take User Input
Function takes input from the user
.upper() converts input to uppercase
global keyword allows access to variable outside
the function
EXPLANATION OF THE CODE
Quiz Instructions
Display instruction to the user
EXPLANATION OF THE CODE
Loop Through Questions And Display Options
Loops through each question in the dictionary
question → question text
data → options and correct answer
Prints all multiple-choice options.
EXPLANATION OF THE CODE
Creating Timer Using Thread , Time-Out
Condition And Answer Checking Logic
Starts the input function in a separate thread
timeout=5 → user has only 5 seconds
If time exceeds, input is ignored
If the user does not answer within time, this
message is shown
Correct answer → score increases
Wrong answer → correct option is displayed
EXPLANATION OF THE CODE
Final Score Display
Displays total marks obtained.
Conclusion
This Quiz Game project demonstrates how Python dictionaries, loops, and
threading can be used to create an interactive application.
The automatic time-out feature makes the quiz more realistic and engaging.
This project is suitable for first-year engineering students and helps in
understanding core Python programming concepts