Question

Written in Python In this lab, you are to build a trivia game. The game should...

Written in Python

In this lab, you are 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.

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.

Your 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)

You will be graded on your program design and how well you incorporated what you have learned.   If you get stuck or need some guidance, please feel free to ask.

To get you 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?

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# function for giving choice to the user to play or exit from the game
def world(x):
print(" Press '1' for Playing game ")
print(" Press '2' to Exit from TRIVIA's WORLD ")
  
n=1
print(world(2))
#loop for running the game as many times the user want to play
while n>0:
# take user response ,1 for playing and 2 to exit from the game
opt=int(input(" Enter your choice :"))
# if user give 1 as input, the game starts:
if opt==1:
print("***** WELLCOME TO TRIVIA GAME *****")
name=input("enter your name:")
  
print("Hello ",name)
  
  
  
print("You Will be asked with 7 question containg 4 options.\
you have to only tell the correct option.\
correct answer will rise your score by 1 & worng answer will let your score remain same")
  
  
  
print(" so lets start the game ....")
  
print(" press '7' to start the game ")
#Ask user to input 7 to start the game
start=int(input("Enter your choice:"))
if start==7:
  
point=0

# time module is used to add delay in the execution of program
import time
print(" So the frist question is on your screen ")
# time.sleep ise used for giving time delay of 1 second:
time.sleep(1)
  
  
q1=''' (Q-1) Grand Central Terminal, Park Avenue, New York is the world's:
(a) largest railway station
(b) highest railway station
(c) longest railway station
(d) None of the above '''
  
print(q1)
  
  
ans=input(" Enter your choice :")
  
if ans=="largest railway station":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
print(" your total score is :",point)
  
print(" So the Second question is on your screen ")
time.sleep(1)
  
  
q2=''' (Q-2) Entomology is the science that studies :
(a) Behavior of human beings
(b) Insects
(c) The origin and history of technical and scientific terms
(d) The formation of rocks '''
  
print(q2)
  
  
ans=input(" Enter your option :")
  
if ans=="Insects":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
  
print(" your total score is :",point)
  
print(" So the Third question is on your screen ")
time.sleep(1)
  
  
q3=''' (Q-3) FFC stands for :
(a) Foreign Finance Corporation
(b) Film Finance Corporation
(c) Federation of Football Council
(d) None of the above '''
  
print(q3)
  
  
ans=input(" Enter your option :")
  
if ans=="Film Finance Corporation":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
  
print(" your total score is :",point)
  
print(" So the Fourth question is on your screen ")
time.sleep(1)
  
  
q4=''' (Q-4) Galileo was an Italian astronomer who :
(a) developed the telescope
(b) discovered four satellites of Jupiter
(c) discovered that the movement of pendulum produces a regular time measurement
(d) All of the above '''
  
print(q4)
  
  
ans=input(" Enter your option :")
  
if ans=="All of the above":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
  
print(" your total score is :",point)
  
print(" So the Fiveth question is on your screen ")
time.sleep(1)
  
  
q5=''' (Q-5) First human heart transplant operation conducted by Dr. Christian Bernard on Louis Washkansky, was conducted in :
(a) 1967
(b) 1968
(c) 1958
(d) 1922 '''
  
print(q5)
  
  
ans=input(" Enter your option :")
  
if ans=="1967":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
  
print(" your total score is :",point)
  
print(" So the Sixth question is on your screen ")
time.sleep(1)
  
  
q6=''' (Q-6) Epsom (England) is the place associated with :
(a) Horse racing
(b) Polo
(c) Shooting
(d) Snooker '''
  
print(q6)
  
  
ans=input(" Enter your option :")
  
if ans=="Horse racing":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
  
print(" your total Money is :",point)
  
print(" So the Seventh question is on your screen ")
time.sleep(1)
  
  
q7=''' (Q-7) Fastest shorthand writer was :
(a) Dr. G. D. Bist
(b) J.R.D. Tata
(c) J.M. Tagore
(d) Khudada Khan '''
  
print(q7)
  
  
ans=input(" Enter your option :")
  
if ans=="a":
  
print(" Your answer is correct")
  
point+=1
  
print(" Your total score is:",point)
else:
  
print(" Your answer is wrong")
  
  
print(" your total score is :",point)
  
  
  
print(name," You Final score is : ",point," out of 7" )
  
print(world(2))
#if user input 2 then the game Exit
if opt==2:
print(" Thanks for visiting in TRIVIA'S WORLD ")
n=n-1
break
  

Add a comment
Know the answer?
Add Answer to:
Written in Python In this lab, you are to build a trivia game. The game should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT