Skip to content

Instantly share code, notes, and snippets.

@dixonwhitmire
Created November 20, 2021 11:54
Show Gist options
  • Save dixonwhitmire/1a7f7edef937330697a5d777520ee027 to your computer and use it in GitHub Desktop.
Save dixonwhitmire/1a7f7edef937330697a5d777520ee027 to your computer and use it in GitHub Desktop.
Chunk A List
def chunk(sequence: List, step: int):
for i in range(0, len(sequence), step):
yield sequence[i:i + step]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment