Iterating over Python list a slice at a time

Posted by jrdioko on Stack Overflow See other posts from Stack Overflow or by jrdioko
Published on 2010-04-19T23:20:15Z Indexed on 2010/04/19 23:23 UTC
Read the original article Hit count: 313

Filed under:
|
|

I'd like to iterate over a list in Python several (say, 10) elements at a time, processing each slice one by one. I can think of a few ways to do this, but none seems obvious and clean. What is the most Pythonic way to do this?

© Stack Overflow or respective owner

Related posts about python

Related posts about pythonic