STEP 5: Let's continue building our password! Let's add the last letter of the website the user enters.

  • Find this line in your code that you created in the last activity: password·=·website[0]¬
  • Type + site[-1] to the end of the line so that the code says password = website[0] + website[-1]
  • Run your program. The display shows the first and last letter of the website you enter!

Using [-1] as the index is called negative indexing. It always gives you the last value of a list or string!

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)