STEP 13: To prevent finding the same letter guess again, let's make the letter uppercase.

  • Append .upper() to the recent code, like this: word_list[letter_index] = letter_guess.upper()

Using .upper() prevents us from finding the same letter over and over. Because we use .lower() when the user guesses a letter, we know that the guess will never match the same letter in uppercase. Specifically, now word_list.index(letter_guess) won't find the same letter twice.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)