Created
January 13, 2020 11:34
-
-
Save upbit/7d05029ff13ce27234bd94a650e2f6e2 to your computer and use it in GitHub Desktop.
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 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