Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use this lab in PYTHON and try to build a trivia game. The game should present each question either in order or randomly to

Please use this lab in PYTHON and try to build a trivia game. 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.
Develop this code and try to use as many of these tools and techniques that learned about in Chapters in text. This code will need to add comments to the code with why you selected them and a brief description on how it works.
The 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 can use. The correct answers have been denoted with an asterisk. Or may use own questions if like. When load the questions into this program, may re-write them however it need to.
How many computer-generated effects were used in the movie Lord of the Rings - Return of the King?
540
799
1205
*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:#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)
import random
import time
def main():
try:
welcome()
game()
playgain()
except:
print("")
def welcome():
print(f"Welcome to the game")
#welcome instructions
test = dict{}
test["q1"]=(1,2,3,4)
#gety user input play
#game
#play again
#end
Please answer asap and follow instruction. Thanks.

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_2

Step: 3

blur-text-image_3

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions