Question
8.10 Python Assignment: Create a Quiz In this program you will create a quiz containing 5 questions. Create a list of strings that stores the
8.10 Python Assignment: Create a Quiz
In this program you will create a quiz containing 5 questions.
Create a list of strings that stores the questions:
"What is the best major?"
"Who is the best prof?"
"What is the best school?"
"What is the coolest name for a prof?"
"What is the best club on campus?"
Create a list of strings that stores the correct answers to each question:
"Computer Science"
"Ryan Hermle"
"ARC"
"Herm-Dawg"
"Embedded Systems Club"
Note: Make sure to match the strings exactly, the tester will require every character to match.
Ask the user each of the questions.
Normally you would use a loop for this, but for now just access each question using index notation
Compare their answers to the corresponding correct answers in your array.
Use the membership in operator with an if statement (see section 8.8)
Keep a count of the number of correct answers.
When the loop completes, show them the total score out of the total possible, and display the percent correct.
Sample output:
What is the best major? asdf Who is the best prof? Ryan Hermle What is the best school? ARC What is the coolest name for a prof? Herm-Dawg What is the best club on campus? Basket Weaving 3 out of 5 0.6 %
8.10.1: Python Assignment: Create a Quiz
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started