第 9 步:现在我们有了一个字符串列表,我们可以循环查看每个单词的第一个字母!

  • 拖出Loop through List 。这将为列表中存储的每个字符串循环一次。
  • value更改为word并将my_list更改为purpose_words_list .
  • 在循环中添加缩进的Print Variablemy_var更改为word [ 0 ]

print( word [ 0 ])使用字符串索引来打印每个单词的第一个字母。

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
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)