0% found this document useful (0 votes)
32 views

Python

The document describes a project report for a mini project on a snack game. It includes sections on the introduction, working and code of the project. The report is submitted by two students for their diploma to the computer engineering department.

Uploaded by

desaikrish713
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Python

The document describes a project report for a mini project on a snack game. It includes sections on the introduction, working and code of the project. The report is submitted by two students for their diploma to the computer engineering department.

Uploaded by

desaikrish713
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

A

PROJECT REPORT
ON
MINI PROJECT
ENTITLED

“Snack Game”
SUBMITTED BY
Dhokiya Smit S. (226090307023)
Manga Ketan M. (226090307052)

To
COMPUTER ENGINEERING DEPARTMENT
C U SHAH GOVT. POLYTECHNIC – SURENDRANAGAR

GUJARAT TECHNOLOGICAL UNIVERSITY – AHMEDABAD


JANUARY – 2023
C.U. SHAH GOVERNMENT POLYTECHNIC - WADHWAN

COMPUTER ENGINEERING

CERTIFICATE
This is to certify that the Mini Project entitled “________Quiz Game_____________” has

been carried out by ______Dhokiya Smit S.____________. under my guidance in partial

fulfilment of the degree of Diploma Engineering in COMPUTER ENGINEERING 3nd

Semester of Gujarat Technological University, Ahmedabad during the academic year 2023

Guides:

Mr.N.V. Limbad Mr. K.G. Patel

Internal Guide Head of Department


C.U. SHAH GOVERNMENT POLYTECHNIC - WADHWAN

COMPUTER ENGINEERING

CERTIFICATE
This is to certify that the Mini Project entitled “_______Quiz Game____________” has been

carried out by ___________Manga Ketan M.______________. under my guidance in partial

fulfilment of the degree of Diploma Engineering in COMPUTER ENGINEERING 2nd

Semester of Gujarat Technological University, Ahmedabad during the academic year 2023

Guides:

Mr.N.V. Limbad Mr. K.G. Patel

Internal Guide Head of Department


Introduction to Project
Welcome to the Python Quiz Challenge, where your programming
knowledge will be put to the ultimate test! Whether you're a seasoned
developer or a beginner taking your first steps into the world of Python, this
quiz game is designed to both educate and entertain. Get ready to embark on
a journey through the fascinating realm of Python programming!

Section 1: What is Python?


Python is a high-level, versatile programming language that has gained
immense popularity for its simplicity and readability. Created by Guido van
Rossum and first released in 1991, Python has become a cornerstone in
various domains, including web development, data science, artificial
intelligence, and more. This quiz game aims to explore the depth and breadth
of Python, covering both fundamental concepts and advanced topics.

Section 2: Why a Quiz Game?


Learning programming can be challenging, but it doesn't have to be dull. The
Python Quiz Challenge adds an element of fun and interactivity to the
learning process. By participating in this quiz, you'll reinforce your
understanding of Python while enjoying the thrill of answering thought-
provoking questions. Whether you're a student looking to enhance your
programming skills or a professional seeking a quick and engaging refresher,
this quiz is tailored for you.

Section 3: How the Game Works


The Python Quiz Challenge consists of multiple rounds, each focusing on
different aspects of Python programming. You'll encounter questions
ranging from basic syntax to advanced topics like decorators and generators.
The game is designed to accommodate players of all skill levels, with varying
difficulty levels for each question.
Players will earn points based on the correctness and speed of their
responses. The faster you answer correctly, the more points you accumulate.
The leaderboard will showcase the top scorers, adding a competitive edge to
the learning experience. Don't worry about making mistakes—each
incorrect answer provides valuable feedback to reinforce your knowledge.

Section 4: Features and Highlights


Diverse Question Types: Multiple-choice, true/false, and code-based
questions offer a well-rounded quiz experience.
Rich Content: Explore a wide range of Python concepts, from basic data types
to advanced topics like asynchronous programming.
Adaptive Difficulty: The quiz adapts to your skill level, ensuring a challenging
yet enjoyable experience for participants at all stages of their Python
journey.
Real-time Feedback: Receive instant feedback on your answers, with
explanations to deepen your understanding.
Community Interaction: Connect with fellow Python enthusiasts, share your
achievements, and discuss challenging questions on our dedicated platform.
Working of Project
1.Set Up Questions:
◊ Define a set of questions, each with a text prompt, a list of answer
choices, and the correct answer.

2. Ask Questions to the User:


◊ Iterate through the list of questions.
◊ Display the question prompt and answer choices to the user.
◊ Prompt the user to input their answer.

3. Scorekeeping:
◊ Keep track of the user's score.
◊ Update the score based on whether the user's response is correct.

4. Expand and Enhance:


◊ You can expand the game by adding more questions, categories, or
difficulty levels.
◊ Consider adding a timer or a countdown for each question.
◊ Experiment with graphical interfaces using libraries like Tkinter or
Pygame for a more interactive experience.

Code of Project
# Quiz questions and answers
questions = [
{
"question": "What is the capital of France?",
"options": ["Paris", "London", "Berlin", "Madrid"],
"answer": "Paris"
},
{
"question": "Which planet is known as the Red Planet?",
"options": ["Jupiter", "Mars", "Venus", "Saturn"],
"answer": "Mars"
},
{
"question": "What is the largest mammal in the world?",
"options": ["Elephant", "Blue Whale", "Giraffe", "Hippopotamus"],
"answer": "Blue Whale"
}
]

def run_quiz(questions):
score = 0
total_questions = len(questions)

for i, question_data in enumerate(questions, start=1):


print(f"Question {i}: {question_data['question']}")

# Display options
for idx, option in enumerate(question_data['options'], start=1):
print(f"{idx}. {option}")

# Get user input for answer


user_answer = input("Enter the number of your answer: ")

# Validate the answer


correct_answer = question_data['answer']
if user_answer.isdigit() and 1 <= int(user_answer) <=
len(question_data['options']):
user_answer_index = int(user_answer) - 1
if question_data['options'][user_answer_index] == correct_answer:
print("Correct!")
score += 1
else:
print(f"Wrong! The correct answer is: {correct_answer}")
else:
print("Invalid input! Skipping this question.")
print(f"\nYou've completed the quiz!\nYour score is:
{score}/{total_questions}")
# Run the quiz
run_quiz(questions)

Screenshots
References

1.https://www.apnacollege.in.com/

2.https://chat.openai.com/

3.https://www.google.com/

4.www.youtube.com

5.https://www.w3schools.com/

You might also like