factorial
This commit is contained in:
@ -4,8 +4,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`.
|
||||
|
||||
```python
|
||||
|
||||
```python
|
||||
|
||||
from math import ceil
|
||||
|
||||
@ -14,7 +13,6 @@ def chunk(arr, size):
|
||||
return list(
|
||||
map(lambda x: arr[x * size:x * size + size],
|
||||
list(range(0, ceil(len(arr) / size)))))
|
||||
|
||||
```
|
||||
|
||||
``` python
|
||||
|
||||
Reference in New Issue
Block a user