Title
import getpass, sys
def question_with_response(prompt):
print("Question: " + prompt)
msg = input()
return msg
questions = 4
correct = 0
print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(questions) + " questions.")
question_with_response("Are you ready to take a test?")
rsp = question_with_response("What does the NBA stand for?")
if rsp == "National Basketball Association":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("What team has the theme color of Purple and Yellow?")
if rsp == "Lakers":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("Who is the best player on the Lakers?")
if rsp == "Lebron James":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("What is the line on the side of the court called?'")
if rsp == "Sideline":
print(rsp + " is correct!")
correct += 1
else:
print(rsp + " is incorrect!")
rsp = question_with_response("What do you shoot when you get fouled?'")
if rsp == "Free Throws":
print(rsp + " is correct!")
correct += 1
print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))