I have already tried many times to fix this problem, but I can not solve it in any way. I use an index as a variable to move the user to the next question, but after correct and incorrect answers, the index remains at 0.
score = 0
index = 0
num = 0
user_answer = ""
correct = ""
#------------------------------------------------------------------------------
question_list = ["What is this shape? \na. Square \nb. Triangle \nc. Oval \nAnswer: ", "What color is this shape? \na. Blue \nb. Red \nc. Orange \nAnswer: "]
answer_list = ["a", "c"]
def AnswerCheck (num):
global user_answer, correct, index, score
while (correct == "false"):
user_answer = input(question_list[num])
if (user_answer == answer_list[num]):
score += 1
print("Correct!")
print("Score:", score)
print("\n")
else:
print("Incorrect!")
print("Score:", score)
print("\n")
index = index + 1
while index < len(question_list):
correct = "false"
AnswerCheck(index)