第5步:现在让我们在一个语句中使用变量。

记住,我们组合字符串和字符串变量,就像这样 ("My favorite food is " + fav_food)。

  • 使用程序中已经存在的 .say() 指令,让精灵说出用户最喜欢的季节。
  • 组合字符串和变量,让精灵说 "My favorite season is "
  • 使用加号 + 将 season 添加到语句的末尾。

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)