Issue 27857: n identical objects divide into m different groups (original) (raw)

hello, everyone. I'm a newbie learner.^^ Recently, I learn the itertools and write this function... heap(m,n)-----> X=[] X.append([n ,0,...,0] (len=m)) X.append([n-1,1,...,0]) ... X.append([n-1,0,...,1]) X.append([n-2,2,...,0]) X.append([n-2,1,1..,0]) ... X.append([0 ,0,...,n]) return X