import getpass, sys

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

questions = 6
correct = 0

print('Hello, ' + getpass.getuser() + " running " + sys.executable)

#This command asks for your name and also introduces you on how to input a message.
print("What is your name?")
msg = input("My name is: ")
print("Hi " + msg)

print("You will be asked " + str(questions) + " questions.")
question_and_answer = ("Are you ready to take a test?")

questionsType = ["1. What command is used to output a message?", "2. What is the word in Python that defines a function?", "3. How do you access vscode through a terminal?", "4. What is your Teacher's name?", "5. What language are we learning?", "6. What period do you have APCSP?"]
answersType = ["print", "def", "code .", "Mr. Yeung", "python", "4"]

#I am using the for loop
for i in range(0, 6):
    rsp = question_with_response(questionsType[i])
    if rsp == answersType[i]:
        print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

#This calculates and tells you your score. 
print(msg + " you scored " + str(correct) +"/" + str(questions))
Hello, haeryny running /bin/python3
What is your name?
Hi Haeryn
You will be asked 6 questions.
Question: 1. What command is used to output a message?
print is correct!
Question: 2. What is the word in Python that defines a function?
def is correct!
Question: 3. How do you access vscode through a terminal?
code . is correct!
Question: 4. What is your Teacher's name?
Mr. Yeung is correct!
Question: 5. What language are we learning?
python is correct!
Question: 6. What period do you have APCSP?
4 is correct!
4 is incorrect!
Haeryn you scored 6/6