News for hackers. Stuff that matters.
Re:Python iteration by ff0066mote on Wednesday April 25, 2012 @06:00PM (#3891338)
I would have liked to have seen mention of this while loop instead of the index-based one.

    while my_list:
        v = my_list.pop(0)
        print v
Although it doesn't fit the theme of the others because it consumes the list, it is certainly a more natural use of "while" to loop over a list.

There are no comments on this comment yet.