Thomas
New Coder
Hello! I am making this hangman game for school and unfortunately the letters always display as incorrect even if they are in the word.
Python:
while wrong < MAX_WRONG and so_far != word:
print(hangjerry[wrong])
print("You've used the following letters:", used)
print("So far, the word is:", so_far)
guess = input("Enter your guess: ")
guess = guess.upper()
if guess in used:
print("You've already guessed the letter", guess)
used.append(guess)
if guess in word:
print("Yes!", guess, "is in the word!")
new = ""
for i in range(len(word)):
if guess == word[i]:
new += guess
else:
new += so_far[i]
so_far = new
else:
print("Sorry,", guess, "isn't in the word.")
wrong += 1