Step 1: Another way to make your code more efficient is to use lists with loops!

Using a loop with a list allows us to repeat commands for every item stored in the list. In this program, we will use a list to store image labels, then loop through the list to create the sprite and assign actions!

  • Place a #comment on the line above the beginning of the first section of code that is used more than once.
  • Place a #comment on the line below the end of the first section of code that is used more than once.

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)