Created
March 24, 2014 00:49
-
-
Save amitittyerah/9732300 to your computer and use it in GitHub Desktop.
array_chunk($arr, $size) version of Python
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 array_chunk(arr, size): | |
chunks=[arr[x:x+size] for x in xrange(0, len(arr), size)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Isn't the code lacking a "return chunks" line?