I am using a for loop for numbering for my input answers. If the user gets a correct answer, it will stored in the list. But, if the user want to repeat the answer, it will print out that the user repeated the answer but the problem is, instead of inputting in the same number, it will go on the next number
answer = []
while lives > 0:
while repeat:
for i in range(0,10):
answerlst = input(str(i + 1) + '. ').upper()
if answerlst in text:
if answerlst in answer:
print("You repeated your answer!")
repeat = True
else:
answer.append(answerlst)
repeat = False
else:
print("Incorrect. You just lose a life")
lives -= 1
if lives == 0:
print("GAME OVER!!!!!\n")
break
ask = input("\nWanna play again? [Y] / [N]: ").upper()
if ask == 'Y':
tryAgain = True
else:
tryAgain = False
Example:
- Dark
- Dark You repeated your answer!
- #This is the problem
Instead of inputting in number 3, it should be number 2 because it only repeats the answer.