Python Trivia Assignment

Create a 3 question trivia game in Python.

Step 1

  • Write at least 3 questions within the same topic
  • Use input() function to get user answers to the questions
  • Use if statements to determine whether the user is correct
  • Tell the user when they get a question right

Step 2

  • Use “else” statements to print a message when the user is incorrect
  • Keep score and print the user’s score at the end

Step 3

  • Allow answers that are “ok” but not the best answer
  • Give different amount of points for “ok” answers
  • Use “if”, “elif”, and “else” statements to decide if an answer is good, ok, or incorrect.

Step 4

  • Create 3 different trivia questions on a different topic.
  • Before the user answers any questions, ask them which trivia topic they want.
  • Use nested if/else statements to include your trivia questions inside the if/else branches of your topic choice.

Extra Features

  • Add time delays between prints
  • Add a timer behind the scenes and use it to determine scores
  • Colored text
  • User lower() function to make answers not case sensitive
  • Use random numbers to generate math questions
  • Incorporate lists: accept any response from a list of correct answers
  • Store the questions in a list
  • Use a while loop to force a valid response to the category question or any of the quiz questions
  • Allow the user 2 or 3 tries, but give more points if they get it right the first time
  • Add the ability to get a hint
  • Add the ability to skip a question