第 12 步:现在我们已经完成了对单词的编码,我们需要返回它!

规则:使用 return声明 在函数末尾返回一个值,以便可以在函数外部使用。

  • 并将Return Statement拖动到函数内部,但在循环外部。
  • return语句中的变量从my_varcode_word

此函数将返回code_word的值。我们传入了"hello" ,所以它会返回: "ellohay"

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)