- Code: Select all
counter = -1
import random
questions = ["What is the capital of France?", "Which country is London locates in?"]
answers = ["Paris", "England"]
print("Enter your answers with a capital letter at the start")
correct = False
while (len(questions)) > 0:
choice = random.choice(questions)
option = input(choice)
each1 = 0
answersl = (len(answers)) - 1
for each2 in questions:
counter = counter + 1
if each2 == choice:
break
for each in answers:
each1 = (each1) + 1
if each == option:
each1 = (each1) -1
if (counter) == (each1):
print("correct")
correct = True
break
if correct == False:
print("WRONG")
answers.remove(each)
questions.remove(choice)
counter == 0
If you enter an incorrect answer and then a correct answer it will class the correct answer as incorrect
Thanks in advance
