第 9 步:现在让精灵说出他们的信息!

  • 在 click 事件中找到.say( "Hello, name" )命令。
  • 点击进入代码编辑器,将"Hello, name"更改为"Remember to social distance!" .
  • 确保不要删除引号" "或缩进。
  • 点击运行。等待精灵停止移动,然后单击它。

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

stage.set_background("schoolentrance") sprite = codesters.Sprite("cheerleader4") sprite.move_down(150) stage.wait(2) sprite.turn_right(360) def click(sprite): sprite.say("Hello, name") sprite.event_click(click)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)