EXERCISE 3: Another way to make your code more efficient is to use lists with loops!

  • See how this program runs the same block of code again, but for a different sprite? Let's use a list to make this easier to read.
  • Go to LOGIC, click on and drag out List of Strings BEFORE we make the first sprite.
  • Make the list look like this: ["person1", "person2", "person3"].

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)