May-01-2019, 05:01 PM
I don't get an index error when I run your code with those two sentences. But looping through indexes causes just sort of these problems. It also seems that you are looping through questions twice, once with the for loop on 14, and once with the while loop and i on line 18. If you have a list of questions, and a list of the corresponding words that are the answers to those questions, you should do it with zip:
correct = 0 for question, word in zip(questions, words): print(question) answer = input("Which article? ") if answer == word: print("Right answer") correct += 1 else: print("Wrong answer")
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures