Skip to content

Instantly share code, notes, and snippets.

@kzinmr
Created November 1, 2018 01:35
Show Gist options
  • Save kzinmr/97060786273c96fa4b00395f727a0b72 to your computer and use it in GitHub Desktop.
Save kzinmr/97060786273c96fa4b00395f727a0b72 to your computer and use it in GitHub Desktop.
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
for i in range(0, len(l), n):
yield l[i:i + n]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment