Question: Write a python program to create an interactive quiz on a topic of your choice. Use two lists to hold your questions and answers. The

Write a python program to create an interactive quiz on a topic of your choice. Use two lists to hold your questions and answers. The positions of the questions and answers should correspond in the lists (the answer to the question in position 0 of the question list is in position 0 in the answer list, the second question is in position 1 and the answer to the second question is in position 1, etc. )

For example:

questions = [

"What star is in the center of the solar system?:",

"What is the 3rd planet of the solar system?:",

"What can be broken, but is never held?:",

]

answers = [

"Sun",

"Earth",

"Promise",

]

Your program should loop until the user has answered all the questions correctly (the lists are empty). You will do this by removing the question and the answer from the corresponding lists whenever the user gets the question right (use the python pop function to remove an element from a list). For each iteration of the loop your code will generate a random number to select a question (list index ) and display it to the user. Input the users answer, check the answer list to see if it is correct, and then output a right or wrong message. Additionally, keep track of the number of wrong answers with a counter so you can display a score at the end.

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!