Created
April 1, 2021 05:49
-
-
Save thanakijwanavit/b4fbce51929d3fd7fefbffd0dab070b1 to your computer and use it in GitHub Desktop.
chunking a list
This file contains hidden or 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(items:(list, str), sz:int)->Iterable: | |
return [items[i:i + sz] for i in range(0, len(items), sz) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment