警告:这个程序有一个错误。这个错误是一个逻辑错误:我们的代码运行了,但它并没有达到我们的预期!

规则:列表中的第一项位于索引 0 处。

  • 点击运行并观看舞台,看看有什么问题。
  • 精灵表示列表中的第二个类,但它应该说第一个(这是编码!)。
  • 调试程序,使精灵使用正确的索引说出当天的第一堂课。

To navigate the page using the TAB key, first press ESC to exit the code editor.

student= codesters.Sprite("person13") class_list = ["coding", "history", "math", "science", "english"] first_class = class_list[1] student.say("My first class of the day is " + first_class)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)