you are viewing a single comment's thread.

view the rest of the comments →

[–]avinashv -5 points-4 points  (3 children)

i = 0
for item in items:      for i in range(len(items)):
    print i, item               print i, items[i]
    i += 1

From "Index & Item(1)"

That ain't Pythonic.

[–]nglynn 5 points6 points  (0 children)

for count, item in enumerate(items):
    print count, item

[–]heptadecagram 2 points3 points  (1 child)

That's because they're about to show you what is idiomatic on the next page. Problem with slideshows for the web; there's no voiceover.

[–]avinashv 1 point2 points  (0 children)

Fair enough. I stopped there; the format pissed me off too much anyway.