>>> a = [1, 2, 3] >>> for index, item in enumerate(a): print index, item 1 2 3 >>> b = (1, 2, 3) >>> for index, item in enumerate(b): print index, item 1 2 3 >>> c = {'a':1, 'b':2, 'c':3} >>> for index, item in enumerate(c): print index, item a c b >>> d = "hello world" >>> for index, item in enumerate(d): print index, item h e l l o w o r l d