第 9 步:就像其他值一样,返回值需要存储在变量中!

当我们使用return语句时,我们总是将函数调用的结果存储在return 变量中。

  • 在您的代码中找到stick_person( - 100 , · 0 , · "purple" ) 函数调用行。
  • 在开头添加person1 = ,因此代码person1 = stick_person( -100 , 0 , "purple" )
  • 返回变量person1存储从stick_figure()函数返回的形状精灵列表!

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)