Question: Write a Python program that will create a simple game of trivia for 2 players. First, create a Question class to hold the data for

Write a Python program that will create a simple game of trivia for 2 players. First, create a Question class to hold the data for a trivia question. The Question class should have attributes for the following data:

the trivia question

possible answer 1

possible answer 2

possible answer 3

possible answer 4

the number of the correct answer (1 - 4)

The Question class also should have an appropriate __init__ method, accessors, and mutators. The program should have a list or a dictionary containing 10 Question objects, one for each trivia question. Make up your own trivia questions on subject(s) of your choice.

How the game is played Starting with player 1, each player gets a turn at answering 5 trivia questions, for a total of 10 questions. When a question is displayed, 4 possible answers are also displayed. Only one answer is correct, and if the player selects the correct answer, he/she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner.

Be sure to: to know which player is currently playing prompt each player with 5 questions each and keeping score based on correct answers comment throughout the code when both players are done, display the scores for each player use functions throughout the program. Each function should be modular and completes one task only. add a header and closing statement use a class and object appropriately

Questions and answers are read from a .txt file called quiz.txt

(quiz.txt contents)

Q1. What is Ironman's first name? Dave Tony Jim Steve 2 Q2. Who is Thor's father? Bucky Odin Loki Lauffy 2 Q3. What group is Peter Quill a part of? The Justice League The Valkyre The Ravagers The Guardians of the Galaxy 4 Q4. Which Avenger has the mind stone in their head? Captain America Doctor Strange Vision Spiderman 3 Q5. What animal is Rocket? Raccoon Rabbit Bear Badger 1 Q6. Who cut off Thano's head? Captain Marvel Heimdall Thor Loki 3 Q7. What is the name of the symbiote that attaches himself to Spiderman? Carnage Venom Rage Poison 2 Q8. What was Captain America's weapon of choice? Hammer Shield Sword Axe 2 Q9. What is the name of the Avenger that uses a bow and arrow? Deadshot Green Arrow Hawkeye Bullseye Q10. Which of the following super heroes is blind? Ironman Hulk Black Widow Daredevil 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!