for iteration in python code example
Example 1: how to use iteration in python
>>> a = ['foo', 'bar', 'baz']
>>> for i in a:
... print(i)
...
foo
bar
baz
Example 2: how to use iteration in python
for i = 1 to 10
<loop body>
>>> a = ['foo', 'bar', 'baz']
>>> for i in a:
... print(i)
...
foo
bar
baz
for i = 1 to 10
<loop body>