FOR LOOPS: Loops are extremely useful for repeating actions in your programs. Let's check out a for loop!

  • This program has a for loop in it, but there are some errors with how it's written.
  • Click Run and see that there is a syntax error! Fix this by indenting the code beneath the for loop.
  • Indent all the code beneath the for loop to make sure all of the people are included in the loop.
  • Change the number in range() so that the actions are repeated multiple times!

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)