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.

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

Activity: CodeLens 7.12.9 (clensQuestion6_100_10)

Before you keep reading...

Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.

Activity: CodeLens 7.12.10 (clensQuestion6_100_11)

You have attempted 1 of 10 activities on this page