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 will be asked " + str(questions) + " questions.")
question_with_response("Are you ready to take a test?")

rsp = question_with_response("What is several lines of code called?")
if rsp == "sequence":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What does a python file end in?")
if rsp == ".ipynb":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("how do you remove a directory ?")
if rsp == "rmdir":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")
rsp = question_with_response("Did you get everything right?")
if rsp == "yes":
    print("Good Job!")
if rsp == "no":
    print("Nice try, better luck next time!")
else:
    print("rip better luck next time!")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, jishnus running /bin/python3
You will be asked 3 questions.
Question: Are you ready to take a test?
Question: What is several lines of code called?
yes is incorrect!
Question: What does a python file end in?
.ipynb is correct!
Question: how do you remove a directory ?
rmdir is correct!
Question: Did you get everything right?
Good Job!
rip better luck next time!
jishnus you scored 2/3