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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!