DEMO #2: After we have a list, we can easily loop through it, saving us a bunch of time!

When we loop through a list, the loop runs once for each value in the list.

In this line of code for·value·in·my_list: value is the loop variable, and my_list is the list we are looping through. If the list in your program has a different variable name, you must update the loop list to match!

  • Run the program to see an example. Follow the directions on stage to complete the activity.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE