STEP 15: Okay, we can guess repeated letters, but the game should reveal all correct letters at the same time!

while loops are useful when you don't know how many times the loop should run.

  • From drag While In just under the .say() in the if statement (indented twice!).
  • Change my_var to letter_guess and change my_list to word_list.
  • Now, indent all other lines of code in the if statement so they're also in the while loop (4 lines of code!).

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)