import getpass, sys

def question_and_answer(prompt):
    print("Question: " + prompt)
    msg = input()
    print("Answer: " + msg)
    
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 will be asked " + str(questions) + " questions.")
question_and_answer("Are you ready to take a test?")

rsp = question_with_response("What folder is used to create markdown posts?")
if rsp == "posts":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What folder is used to create notebook posts?")
if rsp == "notebook":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What is the term for submitting a change made in editor?")
if rsp == "commit":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, haoxu running c:\Users\haoxu\AppData\Local\Programs\Python\Python310\python.exe
You will be asked 3 questions.
Question: Are you ready to take a test?
Answer: y
Question: What folder is used to create markdown posts?
posts is correct!
Question: What folder is used to create notebook posts?
notebook is correct!
Question: What is the term for submitting a change made in editor?
commit is correct!
haoxu you scored 3/3