STEP 8: Now we can use our key number to create the encryption shift that will change each letter!

  • From , drag out Addition inside the if statement. It should be indented three times in total!
  • Change my_var to shift_index, change the 2 to alpha_index, and change the 3 to key.

The shift_index is a number that represents the alphabet index position for the encrypted letter.

For example, "a" shifted 5 times will be encrypted as "f"! But what happens if we shift "z" by 5 positions?

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)