Question
#Create this trivia question-answer dictionary: {'What is the rarest M&M color?':'Brown, What is the common name for dried plums?':'Prunes, What was the first soft drink
#Create this trivia question-answer dictionary: {'What is the rarest M&M color?':'Brown, What is the common name for dried plums?':'Prunes, What was the first soft drink in space?':'Coca Cola, Which country invented ice cream?':'China, What geometric shape is generally used for stop signs?':'Octagon'}
#Prompt user to enter the answer of each trivia question in the dictionary.
#Display the trivia question (dictionary key) when prompting the user.
#If the answer is correct, display: Good job! Otherwise, display: Wrong answer!
#At the bottom, display the number of correct answers and the number of wrong answers.
#The program must not be case sensitive
1.Use for in to read every key and value in the dictionary.
2.Use dictionary key in the input.
3.Use if to check whether the input is correct.
4.Create two counter variables: right and wrong.
5.If the answer is correct, increment right. Otherwise, increment wrong.
#Examples:
#What is the rarest M&M color?brown
#Good job!
#What is the common name for dried plums?PRUNES
#Good job!
#What was the first soft drink in space?Coke
#Wrong answer!
#Which country invented ice cream?ChInA
#Good job!
#What geometric shape is generally used for stop signs? Triangle
#Wrong answer!
#Correct answers: 3
#Incorrect answers: 2
#Create this trivia question-answer dictionary: {'What is the rarest M&M color?':'Brown, What is the common name for dried plums?':'Prunes, What was the first soft drink in space?':'Coca Cola, Which country invented ice cream?':'China, What geometric shape is generally used for stop signs?':'Octagon'}
#Prompt user to enter the answer of each trivia question in the dictionary.
#Display the trivia question (dictionary key) when prompting the user.
#If the answer is correct, display: Good job! Otherwise, display: Wrong answer!
#At the bottom, display the number of correct answers and the number of wrong answers.
#The program must not be case sensitive
1.Use for in to read every key and value in the dictionary.
2.Use dictionary key in the input.
3.Use if to check whether the input is correct.
4.Create two counter variables: right and wrong.
5.If the answer is correct, increment right. Otherwise, increment wrong.
#Examples:
#What is the rarest M&M color?brown
#Good job!
#What is the common name for dried plums?PRUNES
#Good job!
#What was the first soft drink in space?Coke
#Wrong answer!
#Which country invented ice cream?ChInA
#Good job!
#What geometric shape is generally used for stop signs? Triangle
#Wrong answer!
#Correct answers: 3
#Incorrect answers: 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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