Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this lab, you are to build a trivia game by using Python Language. The game should present each question - either in order or

In this lab, you are to build a trivia game by using Python Language. The game should present each question - either in order or randomly - to the player, and display up to four possible answers. The player is to input what they believe to be the correct answer. The game will tell the player if they got it right or wrong and will display their score. If they got it right, their score will go up. If they got it wrong, their score will stay the same. After all the questions have been asked, the game will present the final score correct, the final score incorrect and allow the player to play again if they choose. You have a lot of leeway in designing this game and you can use your book though there are minimum requirements to obtain all 30 points (mentioned after this paragraph). Develop your own code and try to use as many of these tools and techniques that you learned about in Chapters in your text. You may leverage other techniques in other Chapters that were not covered if you like, BUT you will need to add comments to the code with why you selected them and a brief description on how it works.
This final script MUST include the following at a minimum:
Main line logic * Error handling (Try/except/else/final)* Header * Comments * Global/local Variables (Users name, counters, etc.)* At least 1 custom function * Use of List/Tuple/Dictionary * Use of at least 1 looping function (while / for)
To get started, here are five, four-answer multiple choice questions that you can use. The correct answers have been denoted with an asterisk. You may use your own questions if you like. When you "load" the questions into your program, you may re-write them however you need to. How many computer-generated effects were used in the movie Lord of the Rings - Return of the King? 5407991205*1488 In the movie "The Blues Brothers", what does Jake order at the diner? A medium pizza with pineapple and ham 3 cheeseburgers with the works and a tall glass of milk *4 fried chickens and a Coke A small Greek salad with extra feta, a steak (well done),2 baked potatoes, and a coffee In The Simpsons, what football team has Homer always wanted to own? Washington Redskins *Dallas Cowboys Denver Broncos Cleveland Browns In the TV show Seinfeld, what did Elaine decide was 'her song'? I am, Woman Desperado Yesterday * Witchy Woman Babe Ruth debuted in professional baseball at the age of 19 years old with which team? * Boston Red Sox New York Yankees St Louis Browns Cincinnati Reds
My Code: When I run it showing Invalid Syntax. Please help me fix it and ans asap. Thanks
ile Edit Format Run Options Window Help8 import rando9 inport tine1011| def main () :1213141516171819212223242520def welcome ():26272831323334353637323930def game ():4041474445464748try:49514 Start the gamewelcome ()32qame ()53play again ()ezcept:print ("An error occurred. ")Display velcome messageStart the gameDisplay a welcome message and instructions to the player .print ("Welcome to the trivia game! ")Ask if theplayer vants to play againprint ("You will be presented with ultiple-choice questions.")print ("please input the number corresponding to your ansver.")print (0questionsPresent questions to the player, get their ansvers, and update scores.LDefine questions and their corresponding ansvers"How any computer-generated effects vere used in the movie Lord of the Rings - Return of the King":"answers": ("1M: 1488,2": 9,*3*: 7,"4: 540),"correct:1"In the movie 'The Biues Brothers' , what does Jake order at the diner?": |"answer: (: "A edi um pizza vith pineapple and ham, 2*: 3 cheeseburgers with the vorks and a tall glass of milk", "3": "4 fried chickens and a Coke", "q": "A small G"correct: 2"in The Simpsons, what foothall team has Homer alvays vanted to own2":Tansvers": (: Manhington Redskins", 2*: "Dallas Coxboys", "": "Denver Broncos", 4"; "Cleveland Browns"),coTEect"in the TV show Seinfeld, hat did Blaine decide vas 'her song'2: (Tanimsers: am Woman, 2*: "Desperado", *3": "Yesterday", "": "itchy Noman "),*habe Ruth debuted in professional baseball at the age of 19 years old.vith which team 2": |TansaersE E hoston Red Sox", 2; "New York Yankees", "3": "st Louis Browns", "4": "cincinnati Reds"),
981"Babe Ruth debuted in professional baseball at the age of 19 years old with which team? " : ("answers"; ("1n: "Boston Red Sox", "2": "New York Yankees", "3": "st Louis Browns", "4": "Cincinnati Reds"),"correct": "1"5COre corect =0 #Counter for COrrect answersscore incorrect =0 # Counter for incorrect answers# Shuffle questionsquestions list = list (questions. keys ())random.shuffle (questions list)for question in questions list:print (question)answers = questions [question]["answers"]for i in range (1,5):print (f"(i) : (answers [str (i)])")user ans
having problems with if, else and elif...showing invalid syntax.
please answer asap
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Comment should this MNE have a global LGBT policy? Why/ why not?

Answered: 1 week ago