import itertools
cmb = []
for i in range(1, n + 1):
    cmb.extend(itertools.combinations(range(1, n + 1), i))
Where's the error in this for loop to generate a list of ordered non-repeated combinations?