Lesson 4 Activity: Trivia Quiz

Another quiz??? This must be a mistake...

...

...

Just kidding. You're not taking a quiz this time, you're making one using conditionals! You can test your friends on trivia by asking questions which they have to input an answer to. Then you check IF their answers are equal to the correct answer and tell them. You can even keep track of a score accordingly! We're slowly layering concepts here, so try to remember the things we've learned: input, printing, variables, AND conditionals. Here's a short example below:


print("Enter the letter A, B, or C for each question")
score = 0

print("What's the third planet from the sun?")
print("A - Earth")
print("B - Mars")
print("C - Pluto")

ans1 = input("Your Answer: ")

if ans1 == "A":
  print("correct!")
  score = score + 1
else:
  print("wrong!")

print("Final Score:", score)



You can add as many questions as you want and test your friends through replit. Go ahead and give it a shot!