Created
November 20, 2021 11:54
-
-
Save dixonwhitmire/1a7f7edef937330697a5d777520ee027 to your computer and use it in GitHub Desktop.
Chunk A List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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