>>> for index, letter in enumerate('foobar'):
... print index, letter
...
0 f
1 o
2 o
3 b
4 a
5 r
>>>
Created
July 11, 2013 22:23
-
-
Save jfriedly/5979784 to your computer and use it in GitHub Desktop.
How to iterate over something with an index using enumerate. Keywords: counter, i, iterable, list, dict, dictionary, Python
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment