'Hangman Game - IndexError: list index out of range - It's because of my for loop on line 89 but I don't know how to fix it
Traceback (most recent call last): File "main.py", line 89, in update += guesses[i] IndexError: list index out of range
On line 89, only happens if you input a correct letter, I know it's because of the list not having a way to stop after a certain number but I don't know what to add to make that happen, I thought I knew but my mind is blank.
Code area that has error
update = ""
for i in range(len(word)):
if Guess == word[i]:
update += Guess
else:
update += guesses[i]
guesses = update
Full code: https://github.com/BUBBLEGUM846/BUBBLEGUM846/blob/main/Hangman
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
