Overview This program will welcome a user to the trivia builder 3000, then prompt the user to add questions to the trivia bank. After the user indicates they are done it will print out the contents of the trivia bank. Expected Output Example 1 Welcome to the trivia builder 3000 Enter the next question: Who was the fifth Beatle? Enter the correct answer for that question: Pete Best Enter the next question: You did not enter a question, let's try again. Enter the next question: How many dimples does a golf ball have? Enter the correct answer for that question: 336 Enter the next question: Done We will stop entering questions now Here is the final trivia dictionary: The question is: Who was the fifth Beatle? And the answer is: Pete Best The question is: How many dimples does a golf ball have? And the answer is: 336 Example 2 Welcome to the trivia builder 3000 Enter the next question: What was the first name for the Beatles? Enter the correct answer for that question: The Quarymen Enter the next question: What is the longest running scripted television show? Enter the correct answer for that question: The Simpsons Enter the next question: You did not enter a question, let's try again. Enter the next question: You did not enter a question, let's try again. Enter the next question: What year did Good Will Hunting come out? Enter the correct answer for that question: 1997 Enter the next question: Done We will stop entering questions now Here is the final trivia dictionary: The question is: What was the first name for the Beatles? And the answer is: The Quarymen The question is: What is the longest running scripted television show? And the answer is: The Simpsons The question is: What year did Good Will Hunting come out? And the answer is: 1997

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Overview
This program will welcome a user to the trivia builder 3000, then prompt the user to add questions to the trivia bank. After the user indicates they are done it will print out the contents
of the trivia bank.
Expected Output
Example 1
Welcome to the trivia builder 3000
Enter the next question: Who was the fifth Beatle?
Enter the correct answer for that question: Pete Best
Enter the next question:
You did not enter a question, let's try again.
Enter the next question: How many dimples does a golf ball have
Enter the correct answer for that question: 336
Enter the next question: Done
We will stop entering questions now
Here is the final trivia dictionary:
The question is: Who was the fifth Beatle?
And the answer is: Pete Best
The question is: How many dimples does a golf ball have?
And the answer is: 336
Example 2
Welcome to the trivia builder 3000
Enter the next question: What was the first name for the Beatles?
Enter the correct answer for that question: The Quarymen
Enter the next question: What is the longest running scripted television show?
Enter the correct answer for that question: The Simpsons
Enter the next question:
You did not enter a question, let's try again.
Enter the next question:
You did not enter a question, let's try again.
Enter the next question: What year did Good Will Hunting come out?
Enter the correct answer for that question: 1997
Enter the next question: Done
We will stop entering questions now
Here is the final trivia dictionary:
The question is: What was the first name for the Beatles?
And the answer is: The Quarymen
The question is: What is the longest running scripted television show?
And the answer is: The Simpsons
The question is: What year did Good Will Hunting come out?
And the answer is: 1997
Transcribed Image Text:Overview This program will welcome a user to the trivia builder 3000, then prompt the user to add questions to the trivia bank. After the user indicates they are done it will print out the contents of the trivia bank. Expected Output Example 1 Welcome to the trivia builder 3000 Enter the next question: Who was the fifth Beatle? Enter the correct answer for that question: Pete Best Enter the next question: You did not enter a question, let's try again. Enter the next question: How many dimples does a golf ball have Enter the correct answer for that question: 336 Enter the next question: Done We will stop entering questions now Here is the final trivia dictionary: The question is: Who was the fifth Beatle? And the answer is: Pete Best The question is: How many dimples does a golf ball have? And the answer is: 336 Example 2 Welcome to the trivia builder 3000 Enter the next question: What was the first name for the Beatles? Enter the correct answer for that question: The Quarymen Enter the next question: What is the longest running scripted television show? Enter the correct answer for that question: The Simpsons Enter the next question: You did not enter a question, let's try again. Enter the next question: You did not enter a question, let's try again. Enter the next question: What year did Good Will Hunting come out? Enter the correct answer for that question: 1997 Enter the next question: Done We will stop entering questions now Here is the final trivia dictionary: The question is: What was the first name for the Beatles? And the answer is: The Quarymen The question is: What is the longest running scripted television show? And the answer is: The Simpsons The question is: What year did Good Will Hunting come out? And the answer is: 1997
Specifications
• You should submit a single file called M5A3.py
• It should follow the submission standards outlined here: Submission Standards
• Your program must create an empty dictionary called triviabank_dict that will contain all the question/answer pairs.
Your program must use two strings, question_str and answer_str, and populate them using the input() function before adding their values to the triviabank_dict
• Your program must use a while-loop to populate triviabank_dict and it must have the following behavior:
• If the user inputs a blank line, print a short message indicating that you will try again and then use continue to return to the top of the while-loop
• If the user input "Done" then print a short message indicating that you will stop entering questions and then use break to exit the while-loop
• Otherwise accept their text as a question and use input() to get the corresponding answer.
• After you have populated the dictionary print the contents out as indicated above.
Tips and Tricks
One piece at a time, as always. You also might want to check out:
https://www.geeksforgeeks.org/python-add-new-keys-to-a-dictionary/B>
• https://www.geeksforgeeks.org/break-continue-and-pass-in-python/
Transcribed Image Text:Specifications • You should submit a single file called M5A3.py • It should follow the submission standards outlined here: Submission Standards • Your program must create an empty dictionary called triviabank_dict that will contain all the question/answer pairs. Your program must use two strings, question_str and answer_str, and populate them using the input() function before adding their values to the triviabank_dict • Your program must use a while-loop to populate triviabank_dict and it must have the following behavior: • If the user inputs a blank line, print a short message indicating that you will try again and then use continue to return to the top of the while-loop • If the user input "Done" then print a short message indicating that you will stop entering questions and then use break to exit the while-loop • Otherwise accept their text as a question and use input() to get the corresponding answer. • After you have populated the dictionary print the contents out as indicated above. Tips and Tricks One piece at a time, as always. You also might want to check out: https://www.geeksforgeeks.org/python-add-new-keys-to-a-dictionary/B> • https://www.geeksforgeeks.org/break-continue-and-pass-in-python/
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY