STEP 3: We need to edit the loop in the function so that it uses the parameter that is passed in at the function call.

  • Find the line in the cheer() function that creates the for loop: ····for·letter·in·"go":¬
  • Change "go" to word. Now, whatever value is passed in with the function call will be used for the for loop!
  • Delete the code between the two comments. Instead, call the cheer() function with the argument "go"!
  • Click Run. Our code is more efficient and readable, but the outcome of the program is the same!

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)