第 6 步:我们将使用索引来访问第一个字母!请记住,索引从 0 开始计数。

  • ,在函数内部的Get Value at Index
  • 将变量的名称更改为first_letter
  • my_list替换为列表letters 。我们得到了存储在letters列表中的第一个值!

first_letter现在存储'h' ,因为我们将"hello"传递给pig_latin()函数!

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)