STEP 7: According to our password algorithm, the next step is to take the first letter of each word in the sentence. If we separate the user's response into different strings for each word, we can easily get the first letter of each word!

  • In LOGIC from drag out Split String to List.
  • Change my_list to purpose_words_list. Change my_string to purpose.

.split() takes a string and splits it wherever there is a space. The resulting values are stored in a list!

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)