N-chotomize a list
JavaScript (ES6), 63 bytes
(a,n,l=a.length/n|0)=>[...Array(n)].map(_=>--n?a.splice(0,l):a)
Python, 76 73 bytes
lambda L,N:list(map(lambda x,r=len(L)//N:L[x*r:][:r+(x>N-2)*N],range(N)))
Basically an unnamed function that performs the task. Thanks to LeakyNun for the bytes saved!
Pyth, 11 10 bytes
1 byte thanks to @FryAmTheEggman.
cJEt*R/lJQ
Test suite.
Takes inputs in reversed order.
Sample input:
5
[1,2,3,4,5,6,7]
Sample output:
[[1], [2], [3], [4], [5, 6, 7]]
Explanation
cJEt*R/lJQ Main function, first input:Q, second input:E.
cJEt*R/lJQQ Implicit arguments.
c The function c is special.
It can chop arrays.
If the second argument is a list of integers,
then it chops the first array at the indices
specified by the second array.
JE The first argument is the second input, stored
to the variable J.
t*R/lJQQ This is the second argument.
/lJQ Yield length of J, integer-divided by Q.
*R Q Multiply it to the following respectively:
[0,1,2,3,...,Q-1]
t Then throw away the first element.
For example, if Q=3 and E=[1,2,3,4,5,6,7,8],
we would now have [3,6].