for x in string code example
Example 1: iterate through characters in a string python
for c in "string":
#do something with c
Example 2: enumerate string pythonm
>>> for i, c in enumerate('test'):
... print i, c
...
0 t
1 e
2 s
3 t
for c in "string":
#do something with c
>>> for i, c in enumerate('test'):
... print i, c
...
0 t
1 e
2 s
3 t