week 2 this is my online quiz coded in python. Although it does not work on a jupyter notebook blog page, I can explain how it works. You simply just type in an input and the code will compare it to the preset correct value. If they match, the answer is considered correct.

UPDATE 9/1/2022: Used lists to tell user which problems they got wrong at the end of the quiz, as well as problems right. problems are also stored in a dictionary.

correct = 0 #this part used to keep track of correct answers and show how many correct and percentage at end of quiz
int(correct)
dict = {
  "1": "question 1: Name the Python output command mentioned in this lesson",
  "2": "question 2: If you see many lines of code in order, what would College Board call it?",
  "3": "question 3: Describe a keyword used in Python to define a function?",
  "4": "question 4: What command is used to include other functions that were previously developed?",
}
list = []
crlist = []

print(dict.get("1"))
ans = input()
if ans == "print": #used to determine if answer was right or not
    print(ans, "is correct!")
    correct = correct + 1 #keep track of correct answers
    crlist.append("1")
else:
    print(ans, "is wrong!") 
    list.append("1")


print(dict.get("2")) #basically code from top part, I don't rly know how to make it so I dont have to
ans = input()
if ans == "sequence":
    print(ans,"is correct!")
    correct = correct + 1
    crlist.append("2")

else:
    print(ans, "is wrong!")
    list.append("2")

print(dict.get("3"))
ans = input()
if ans == "def":
    print(ans, "is correct!")
    correct = correct + 1
    crlist.append("3")
else:
    print(ans, "is wrong!")
    list.append("3")


print(dict.get("4"))
ans = input()
if ans == "import":
    print(ans, "is correct!")
    correct = correct + 1
    crlist.append("4")

else:
    print(ans, "is wrong!")
    list.append("4")


(percentage) = (correct/4)*100 #use to calculate percentage of correct
int(percentage)
print("you got", correct, "correct!")
print(percentage, "%")

wrongs = ", ".join(list)
rights = ", ".join(crlist)

print("these questions are wrong:", wrongs)
print("these questions are right:", rights)
question 1: Name the Python output command mentioned in this lesson
print is correct!
question 2: If you see many lines of code in order, what would College Board call it?
def is wrong!
question 3: Describe a keyword used in Python to define a function?
def is correct!
question 4: What command is used to include other functions that were previously developed?
d is wrong!
you got 2 correct!
50.0 %
these questions are wrong: 2, 4
these questions are right: 1, 3