Taiyo's Jupyter MCQuiz
score = 0
# Question 1
answer1 = input("What does Def do in a function? \na. nothing \nb. defines a function \nc. sudo code \nd. changes directory \nAnswer: ")
if answer1 == "b" or answer1 == "defines a function":
score += 1
print ("correct!")
print ("score: ", score)
print ("\n")
else:
print("Incorrect! The answer is: defines a function.")
print("score: ", score)
print("\n")
# Question 2
answer2 = input("What is Python3 \na. A snake \nb. A programming language \nc. A video game \nd. Javascript \nAnswer: ")
if answer2 == "b" or answer1 == "A programming language":
score += 1
print ("correct!")
print ("score: ", score)
print ("\n")
else:
print("Incorrect! The answer is: A programming language")
print("score: ", score)
print("\n")
# Question 3
answer3 = input("What is a sequence? \na. Two or more lines of code \nb. A line of code \nc. multiple words \nd. I dont know \nAnswer: ")
if answer3 == "a" or answer1 == "Two or more lines of code":
score += 1
print ("correct!")
print ("score: ", score)
print ("\n")
else:
print("Incorrect! The answer is: Two or more lines of code")
print("score: ", score)
print("\n")
#Final Message
if score <= 1:
print ("Your total score is:", score, "- Get Better")
elif score == 2:
print ("Your total score is:", score, "- You Did Alright")
else:
print ("Your total score is:", score, "-GOOD JOB!")