factorial

This commit is contained in:
Rohit Tanwar
2018-01-27 11:03:02 +05:30
parent 94a4c53868
commit b5a1fa18ba
17 changed files with 31 additions and 91 deletions

View File

@ -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