chunkify.py |
Split an integer into evenly distributed list
>>> split_evenly(7, 3)
[3, 2, 2]
>>> split_evenly(12, 3)
[4, 4, 4]
>>> split_evenly(35, 10)
[4, 4, 4, 4, 4, 3, 3, 3, 3, 3]
>>> split_evenly(1, 2)
Traceback (most recent call last):
...
ChunkingError: Number of chunks is greater than number
|
1384 |