toc: true layout: post comments: true description: A minimal example of using markdown with fastpages. categories: [jupyter]

title: Review Ticket

 
import getpass, sys

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

questions = 5
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 the primary language used to code?")
if rsp == "python":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What command is used to evaluate correct or incorrect response in this example?")
if rsp == "if":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("Each 'if' command contains an '_________' to determine a true or false condition?")
if rsp == "expression":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What is the name of the window you type code into?")
if rsp == "terminal":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("Is there such thing as perfect code?")
if rsp == "no":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, trey-dev running /bin/python3
You will be asked 5 questions.
Question: Are you ready to take a test?
Question: What is the primary language used to code?
python is correct!
Question: What command is used to evaluate correct or incorrect response in this example?
if is correct!
Question: Each 'if' command contains an '_________' to determine a true or false condition?
expression is correct!
Question: What is the name of the window you type code into?
terminal is correct!
Question: Is there such thing as perfect code?
no is correct!
trey-dev you scored 5/5