Step 2: Lets make this code more efficient with a list and loop!

  • Delete all the code after your second comment.
  • Go to LOGIC, click on and drag out List of Strings just ABOVE your first comment.
  • From , drag out Loop through List just under your list.
  • Indent all the code between the comments so it is inside the loop! Click Next to fix the image label.

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)