Note: If you want your subsets to be unique, but your inputs aren't, you'd need to make modifications e.g. >>> subsets([2,2,2],2) [[2, 2], [2, 2], [2, 2]] >>> subsets([2,2,1],2) [[2, 2], [2, 1], [2, 1]] This algorithm works best when the input sequence contains unique elements. Kirby