pythonreference.com
search statements, functions, methods, exceptions*
show categories
'for' with a list, tuple or set
iterate over each item in a container
items = ['a', 'b', 'c']
for item in items:
print(item)
|
as Python iterates over each item in a container, it assigns the
item to the loop variable (in the example, 'item'), then executes the block.
The assignment and block execution happen once for each
item in the container.