Ben's Gov Quiz
Quiz on the notes from my AP Gov work
import getpass, sys
def question_with_response(prompt):
print("Question: " + prompt)
msg = input()
return msg
questions = 3
correct = 0
print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You are going to take a " + str(questions) + " question quiz.")
question_with_response("Are you ready to take a quiz about media?")
rsp = question_with_response("What is the oldest form of media?")
if rsp == "print":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("Which form revolutionized media?")
if rsp == "internet":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("What role of the media is responsible for controlling what media goes out?")
if rsp == "gatekeeper":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
Percentage = correct/3
print("You got " +str(int(Percentage*100))+"%")