STEP 12: Now that we've finished encoding our word, we need to return it!

RULE: use a return statement at the end of a function to return a value so it can be used outside the function.

  • Go to and drag Return Statement INSIDE the function, but OUTSIDE the loop.
  • Change the variable in the return statement from my_var to code_word.

This function will return the value of code_word. We passed in "hello" , so it will return: "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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)