Update chunk.md

This commit is contained in:
Rohit Tanwar
2018-01-09 10:43:58 +05:30
committed by GitHub
parent 59f23e6579
commit f6de6cc119

View File

@ -2,7 +2,7 @@
Chunks an array into smaller lists of a specified size.
Uses `range` to create a list of desired size. Then use `map` on this list and fill it with splices of `arr`
Uses `range` to create a list of desired size. Then use `map` on this list and fill it with splices of `arr`.
```python
from math import ceil
@ -17,4 +17,4 @@ def chunk(arr, size):
``` python
chunk([1,2,3,4,5],2) # [[1,2],[3,4],5]
```
```