第 1 步:该程序有 3 个不同的功能。让我们重构它以使用一个函数,两个参数!

  • 在程序顶部创建一个新函数,并将其命名为fly()
  • fly()之后的括号中添加两个参数: fly _type让巨嘴鸟可以说他飞多高, fly_height控制巨嘴鸟飞多高!
  • 让巨嘴鸟精灵在函数中说"I flew " + fly_type

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)