第4步:我们想要让字符串成为单个元素的列表。Convert String to List将为我们做到这一点!

例如,如果我们将 "hello" 赋予函数,列表将如下所示:['h', 'e', 'l', 'l', 'o']

  • 中,将 Convert String to List 拖动到函数内部。
  • 将列表在 = 符号前的名称更改为 letters
  • 将变量参数更改为 word

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)