import getpass, sys

def question_with_response(prompt):
    print("Question: " + prompt)
    msg = input()
    return msg

questions = 1
correct = 0

print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(questions) + " questions.")
rsp = question_with_response("Are you ready to take a test?")

rsp = question_with_response("What is def used for?")
if rsp == "to define a variable":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")


print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, matidanish running /usr/local/bin/python3
You will be asked 1 questions.
Question: Are you ready to take a test?
Question: What is def used for?
to define a variable is correct!
matidanish you scored 1/1