1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python for Developers

Connected

Exercise

Looping through a list

You're doing a trial run of cooking the pasta dish. First, you need to list all your ingredients to make sure you have everything ready.

Then, you'll add them one by one as you cook — seven ingredients in total.

Instructions 1/2

undefined XP
  • 1
    • Create a for loop that iterates through the ingredients list, using item as the iterator variable.
  • 2
    • Now create a for loop that iterates from 1 to 6 to keep track of how many ingredients you've added.