0% found this document useful (0 votes)
15 views12 pages

Simple Python Quiz App Project Report

project file

Uploaded by

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

Simple Python Quiz App Project Report

project file

Uploaded by

omdandage21
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

RISHS INTERNATIONAL SCHOOL, MANGADU

ACADEMIC YEAR: 2024-25

PROJECT REPORT ON
Simple Quiz app

ROLL NO : 11218
NAME : Aaditya Molkan

CLASS : XI B
SUBJECT : COMPUTER SCIENCE
Introduction
This Python script is a simple multiple-choice quiz game. It asks the
user a series of questions, checks their answers, and provides
immediate feedback on correctness. At the end, it displays the correct
answers, the user's guesses, and their score as a percentage. It
demonstrates the use of loops, conditional statements, and lists for an
interactive quiz experience.
Source Code
questions = ("How many elements are in the periodic table?: ",
"Which animal lays the largest eggs?: ",
"What is the most abundant gas in Earth's
atmosphere?: ",
"How many bones are in the human body?: ",
"Which planet in the solar system is the hottest?: ")

options = (("A. 116", "B. 117", "C. 118", "D. 119"),


("A. Whale", "B. Crocodile", "C. Elephant", "D.
Ostrich"),
("A. Nitrogen", "B. Oxygen", "C. Carbon-Dioxide", "D.
Hydrogen"),
("A. 206", "B. 207", "C. 208", "D. 209"),
("A. Mercury", "B. Venus", "C. Earth", "D. Mars"))

answers = ("C", "D", "A", "A", "B")


guesses = []
score = 0
question_num = 0
for question in questions:
print("----------------------")
print(question)
for option in options[question_num]:
print(option)

guess = input("Enter (A, B, C, D): ").upper()


[Link](guess)
if guess == answers[question_num]:
score += 1
print("CORRECT!")
else:
print("INCORRECT!")
print(f"{answers[question_num]} is the correct answer")
question_num += 1

print("----------------------")
print(" RESULTS ")
print("----------------------")

print("answers: ", end="")


for answer in answers:
print(answer, end=" ")
print()

print("guesses: ", end="")


for guess in guesses:
print(guess, end=" ")
print()

score = int(score / len(questions) * 100)


print(f"Your score is: {score}%")
Output:

You might also like