All pastes #63988 Raw Edit

listas desempaquetad

public python v1 · immutable
#63988 ·published 2006-06-10 23:56 UTC
rendered paste body
def combinations22(length, n):	if length == 0:		return [()]	if length == 1:		lista = []		for i in range (1,n+1):			lista.append((i,))		return lista	else:		lista = []		for combi in combinations(length-1, n):			for i in range(1, combi[0]):				lista.append((i,) + combi)		return lista