Skip to content

Instantly share code, notes, and snippets.

@russelldavis
Created May 6, 2013 23:34
Show Gist options
  • Save russelldavis/5529147 to your computer and use it in GitHub Desktop.
Save russelldavis/5529147 to your computer and use it in GitHub Desktop.
def chunked_list(lst, size):
"""
Iterates over chunks of a list
"""
for i in xrange(0, len(lst), size):
yield lst[i:i+size]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment