第 11 步:将项目添加到列表的另一种方法是使用 append 命令!

  • 在逻辑中,单击并拖出Append
  • 将其放在.Display()下但循环之前。
  • .append()之前的变量名从my_list更改为pet_list
  • .append()中的my_var替换为字符串"kitten"

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)