第 5 步:现在,看起来我们的精灵只说了一次生日快乐。让我们解决这个问题!

在 Python 中, ""表示字符串为空。这使得我们的精灵看起来好像什么也没说。

  • 并拖出Say 。将它放在 for 循环的末尾,在循环内。
  • .say()前面的名字从sprite改成singer
  • .say()命令中的文本从"I am a sprite."""

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)