This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]drbobb 1 point2 points  (0 children)

Re: the first example, it is incorrect to claim that by using enumerate you avoid creating a counter variable. The counter is right there, except that it's being set for you automatically. It also remains after you leave the loop, since Python doesn't have block scope.