7.12. 👩‍💻 Keeping Track of Your Iterator Variable and Your Iterable

When students first begin using for loops, they sometimes have difficulty understanding the difference between the iterator variable (the loop variable) and the iterable.

The iterable is the object that you will parsing through in a for loop. Generally, this object does not change while the for loop is being executed.

The iterator (loop) variable is the variable which stores a portion of the iterable when the for loop is being executed. Each time the loop iterates, the value of the iterator variable will change to a different portion of the iterable.

Before you keep reading...

Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.

As you go through the codelens window, you will be asked a set of questions.

Activity: CodeLens 7.12.9 (clensQuestion6_100_10)

Activity: CodeLens 7.12.10 (clensQuestion6_100_11)

You have attempted 1 of 10 activities on this page