Skip to content

Instantly share code, notes, and snippets.

@imamdigmi
Created June 11, 2020 06:27
Show Gist options
  • Select an option

  • Save imamdigmi/2867d0189bfb94e5d7b7fe369339c783 to your computer and use it in GitHub Desktop.

Select an option

Save imamdigmi/2867d0189bfb94e5d7b7fe369339c783 to your computer and use it in GitHub Desktop.
Python Chunks Array Size
def chunks(lst, n):
"""Yield successive n-sized chunks from lst."""
for i in range(0, len(lst), n):
yield lst[i:i + n]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment