Quiz I made for you:

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("I will quiz you on these " + str(questions) + " questions.")
def question_and_answer(prompt): #question and answer command
    print("Question: " + prompt)
    msg = input()
    print("Answer: " + msg)

question_and_answer("Are you ready to take my quiz?")

rsp = question_with_response("What command is used to include other functions that were previously developed?")
if rsp == "import":
    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!")

#key vocabulary:

rsp = question_with_response("'Hello, World' is a String literal. This is the referred to as _____, as it does not change?")
if rsp == "static text":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")
    
rsp = question_with_response("Two or more lines of code forms a:")
if rsp == "sequence of code":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("Grouping a sequence of commands, often used repeatedly, is called:")
if rsp == "procedural abstraction":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What key word in Python defines a function?")
if rsp == "def":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")
    

print(getpass.getuser() + " you scored " + str(correct) +"/7")
Hello, dillonlee running /opt/homebrew/opt/python@3.10/bin/python3.10
I will quiz you on these 3 questions.
Question: Are you ready to take my quiz?
Answer: yes
Question: What command is used to include other functions that were previously developed?
import 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: 'Hello, World' is a String literal. This is the referred to as _____, as it does not change?
static text is correct!
Question: Two or more lines of code forms a:
sequence of code is correct!
Question: Grouping a sequence of commands, often used repeatedly, is called:
procedural abstraction is correct!
Question: What key word in Python defines a function?
i dont know is incorrect!
dillonlee you scored 6/7