I can think of at least 2 obvious ways to iterate through something: for loops and comprehensions.
For example, you'll sometimes see people do bad stuff like this:
>>> lst = []
>>>
>>> [lst.append(i + i) for i in range(10)]
[None, None, None, None, None, None, None, None, None, None]
>>>
>>> lst
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>>
When they should be doing this: >>> lst = []
>>>
>>> for i in range(10):
... lst.append(i + i)
...
>>> lst
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>>
Or just this: >>> lst = [i + i for i in range(10)]
>>>
>>> lst
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>> lst = [range(0, 10, 2)] lst = list(range(0, 20, 2))To iterate through it without doing one of those things, you use a for loop.
In “one obvious way to do it”, “it” refers to a concrete task; the same is not necessarily intended to be true of arbitrarily broad generalizations of classes of tasks.