STEP 5: We'll use indexes to access the first letter! Remember, indexes start counting at 0.

Example: If we pass "hello" to the function you're about to build, first_letter would store the value: 'h'

  • From , drag another String Variable INSIDE the function.
  • Change the name of the variable to first_letter.
  • Delete the string and replace it with the list letters. Use an index to get the first letter, like this: letters[0].


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)