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 command is used to change the directory?")
if rsp == "cd":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What command is used to open the list computer file?")
if rsp == "ls":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is wrong!")

rsp = question_with_response("What file type do you make a notebook?")
if rsp == ".ipynb":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is wrong!")
rsp = question_with_response("Did you have fun?")
if rsp == "yes":
    print("Good!")
if rsp == "no":
    print("Well that's too bad!")
else:
    print("oh")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, lukavandenboomen running /Library/Developer/CommandLineTools/usr/bin/python3
You will be asked 3 questions.
Question: Are you ready to take a test?
Question: What command is used to change the directory?
cd is correct!
Question: What command is used to open the list computer file?
ls is correct!
Question: What file type do you make a notebook?
.ipynb is correct!
Question: Did you have fun?
Good!
oh
lukavandenboomen you scored 3/3