Created
June 11, 2020 06:27
-
-
Save imamdigmi/2867d0189bfb94e5d7b7fe369339c783 to your computer and use it in GitHub Desktop.
Python Chunks Array Size
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(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