0% found this document useful (0 votes)
46 views13 pages

Project File Quiz App by Mithul Raj R J & Mayank Rao Kori XI A

The document details a project titled 'Quiz App using Python' completed by students Mithul Raj R J and Mayank Rao Kori as part of their Computer Science curriculum. It includes a certificate of completion, acknowledgments, a declaration of originality, hardware and software requirements, project features, coding examples, and a bibliography of resources used. The app allows users to practice computer science questions in a fun and interactive way.

Uploaded by

mithulrajrj15
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)
46 views13 pages

Project File Quiz App by Mithul Raj R J & Mayank Rao Kori XI A

The document details a project titled 'Quiz App using Python' completed by students Mithul Raj R J and Mayank Rao Kori as part of their Computer Science curriculum. It includes a certificate of completion, acknowledgments, a declaration of originality, hardware and software requirements, project features, coding examples, and a bibliography of resources used. The app allows users to practice computer science questions in a fun and interactive way.

Uploaded by

mithulrajrj15
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/ 13

PROJECT

FILE

COMPUTER SCIENCE

Mithul Raj R J &


Mayank Rao Kori
Class : XI A
APS No-1, Jabalpur
CERTIFICATE

This is to certify that the project entitled Quiz App using Python

has been successfully completed by Mithul Raj R J and Mayank Rao

Kori, a student of Class XI, for the academic session 2025-26, as per

the guidelines issued by CBSE.

The project is a part of the Computer Science curriculum and

has been carried out under my guidance and supervision.

Signature of Teacher : ___________________

Name of Teacher : ___________________

School Stamp

Date :
ACKNOWLEDGEMENT

We would like to express my sincere gratitude to my Computer

Science teacher Namrata Singh, for their valuable guidance and

support throughout this project.

We also thank my friends and family who encouraged us to

complete this project successfully.

Mithul Raj R J & Mayank Rao Kori


DECLARATION

I hereby declare that the project entitled Quiz App using Python

is my original work and has not been submitted anywhere else. This

project has been carried out as part of my academic curriculum.

Mithul Raj R J (Roll Number: 11007)


Mayank Rao Kori (Roll Number: 11006)
Class: XI-A
School: APS No.1 GRC Jabalpur
HARDWARE & SOFTWARE REQUIREMENTS

1. Hardware Requirements:

 Processor : Intel i3 or higher

 RAM : 4GB or more

 Hard Disk : 100 MB of free space

2. Software Requirements:

 Operating System: Windows 10 / Linux

 Python 5.x

 MySQL Server

 MySQL Connector / pymysql

 Text Editor: PyCharm / IDLE


ABOUT THE PROJECT

The Quiz App is a Python-MySQL-based application that allows students


to practice question for their computer science tests/exams in fun way.

Main Features:

 Player Name Input

 Real-Time Answer Feedback

 Score Tracking & Display

 Replay Option

 Timed Transitions

 Error Handling

 Console-Based Interface

 Beginner-Friendly Code
Flowchart

[Start]

[CS Quiz Game by Mithul Raj R J


& Mayank Rao Kori (Class XI)]

[Enter Your Name]

[Welcoming text]

[Starting Quiz]

[Quiz will finish]

[Shows the Score]

[Exit]
Python MySQL Connectivity Part

import mysql.connector

# Connect to MySQL
conn = mysql.connector.connect(
host="localhost",
user="root",
password="your_password",
database="your_database"
)

# Check connection
if conn.is_connected():
print("Connected to MySQL!")

cursor = conn.cursor()
cursor.execute("""
CREATE TABLE student (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
marks INT
)
""")
print("Table created successfully!")

cursor.execute("INSERT INTO student (name, marks) VALUES (%s, %s)",)


conn.commit()
print("Data inserted!")

cursor.execute("SELECT * FROM student")


rows = cursor.fetchall()
for row in rows:
print(row)

cursor.close()
conn.close()
print("Connection closed.")
Coding
import time

# Quiz Questions
questions = [
{"question": "What is Python?", "options": ["A snake", "A programming language", "A game", "An
app"], "answer": 2},
{"question": "Which keyword defines a function?", "options": ["define", "function", "def", "func"],
"answer": 3},
{"question": "What does input() return?", "options": ["Integer", "String", "Float", "Boolean"],
"answer": 2}
]

def play_quiz():
score = 0
print("\n Starting Quiz...\n")
time.sleep(1)

for i, q in enumerate(questions, 1):


print(f"Q{i}: {q['question']}")
for idx, opt in enumerate(q["options"], 1):
print(f" {idx}. {opt}")
try:
user = int(input("Your answer (1-4): "))
if user == q["answer"]:
print("✅Correct!\n")
score += 1
else:
correct = q["options"][q["answer"] - 1]
print(f"❌Incorrect. Correct answer: {correct}\n")
except:
print(" Invalid input. Skipped.\n")
time.sleep(0.5)

print(f" You scored {score} out of {len(questions)}\n")

def main():
print("====================================")
print(" CS Quiz Game by Class 11 Student")
print("====================================")
name = input("Enter your name: ")
print(f"Welcome, {name}! Let's test your CS skills.\n")

while True:
play_quiz()
again = input(" Want to play again? (yes/no): ").strip().lower()
if again != 'yes':
print(f"\nThanks for playing, {name}! ")
break

main()
Output
====================================
CS Quiz Game by Mithul (Class 11)
====================================
Enter your name: mithul

Welcome, mithul! Ready to test your CS skills?

Starting Quiz...

Q1: What is Python?


1. A snake
2. A programming language
3. A game
4. An app
Your answer (1-4): 2
✅Correct!

Q2: Which keyword defines a function?


1. define
2. function
3. def
4. func
Your answer (1-4): 4
❌Incorrect. Correct answer: def

Q3: What does input() return?


1. Integer
2. String
3. Float
4. Boolean
Your answer (1-4): 6
❌Incorrect. Correct answer: String

Q4: Which symbol is used for comments in Python?


1. //
2. #
3. --
4. /*
Your answer (1-4): 2
✅Correct!

Q5: Which data type is immutable?


1. List
2. Tuple
3. Set
4. Dictionary
Your answer (1-4): 4
❌Incorrect. Correct answer: Tuple
Q6: What is the output of 2 ** 4?
1. 6
2. 8
3. 16
4. 24
Your answer (1-4): 3
✅Correct!

Q7: Which of these is a loop in Python?


1. for
2. repeat
3. switch
4. goto
Your answer (1-4): 1
✅Correct!

Q8: Which operator checks equality?


1. =
2. ==
3. equal
4. ===
Your answer (1-4): 1
❌Incorrect. Correct answer: ==

Q9: Which keyword is used to exit a loop?


1. continue
2. exit
3. break
4. return
Your answer (1-4): 3
✅Correct!

Q10: Which one is a valid variable name?


1. my-var
2. 2name
3. _value
4. class
Your answer (1-4): 4\
Invalid input. Skipped.
Q11: What is the full form of IDE?
1. Internet Data Engine
2. Integrated Development Environment
3. Internal Drive Emulator
4. Interactive Device Editor
Your answer (1-4): 2
✅Correct!

Q12: What does len([1, 2, 3]) return?


1. 3
2. 2
3. 1
4. None
Your answer (1-4): 4
❌Incorrect. Correct answer: 3

Q13: Which function converts string to integer?


1. str()
2. int()
3. float()
4. bool()
Your answer (1-4): 6
❌Incorrect. Correct answer: int()

Q14: Which module is used for math operations?


1. math
2. numbers
3. decimal
4. cmath
Your answer (1-4): 4
❌Incorrect. Correct answer: math

Q15: Which keyword is used for recursion?


1. return
2. def
3. call
4. None of these
Your answer (1-4):

Invalid input. Skipped.

You scored 6 out of 15

Want to play again? (yes/no): no

Thanks for playing, mithul!


Bibliography

 Computer Science Textbook (Class XI)

 Author: Sumita Arora


 Publisher: Danpat Rai & Co. Pvt. Ltd.
 Notes: Covers Python fundamentals, control structures, and database basics.

 Python Documentation

 Source: https://docs.python.org/3/
 Notes: Official language documentation. Used for syntax, functions like input(), print(),
loops, and error handling.

 MySQL Connector for Python — Official Docs

 Source: https://dev.mysql.com/doc/connector-python/en/
 Notes: Reference for database connection, SQL execution, and fetching results in Python.

 GeeksforGeeks — Python Programming Articles

 Source: https://www.geeksforgeeks.org/python-programming-language/
 Notes: Concepts like recursion, loops, data types, and sample quiz logic were adapted from
here.

 W3Schools — Python & MySQL Tutorial

 Source: https://www.w3schools.com/python/python_mysql_getstarted.asp
 Notes: Clear explanations of Python-MySQL connectivity, data insertion, and basic CRUD
operations.

 Microsoft Copilot (AI Companion)

 Source: Interactive coding assistance and explanations


 Notes: Guided the structure, enhancements, and feature expansion of the quiz app.

You might also like