STEP 4: Knowing the length of the user's word, we can create a "hidden" string of symbols that is the same length.

Multiplying a string by an integer results in the string text repeated the same number of times as the integer.

  • From , drag in Multiplying Strings. Rename both my_var variables to hidden_string.
  • Change the string "Hello!" to "#" and change the number 4 to the variable word_list_len.

This multiplication creates a "hidden" string with a "#" representing each letter that the word-to-guess has!

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)