Update count_by, chunk_into_n and initial

This commit is contained in:
Veronica Guo
2020-10-22 22:35:06 -04:00
parent c05e62d821
commit 9cd13f560e
3 changed files with 12 additions and 9 deletions

View File

@ -17,10 +17,10 @@ def chunk_into_n(lst, n):
size = ceil(len(lst) / n)
return list(
map(lambda x: lst[x * size:x * size + size],
list(range(0, n)))
list(range(n)))
)
```
```py
chunk_into_n([1, 2, 3, 4, 5, 6, 7], 4)) # [[1, 2], [3, 4], [5, 6], [7]]
chunk_into_n([1, 2, 3, 4, 5, 6, 7], 4) # [[1, 2], [3, 4], [5, 6], [7]]
```