STEP 5: First, we need a variable to store our new coded message and a loop to check each letter in our message.

  • From , drag String Variable indented once inside the encrypt() function.
  • Change the variable name from my_var to new_message and change its value to an empty string: "".

Remember that all code included in a function must be indented!

Note: we've added code to the function, so it is now okay to delete the included pass statement.

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)