Generating combination of a list in python 2

import itertools
li,l= [1, 3, 3],2
for subset in itertools.combinations(li, l):
    print  subset

l is the length of subsequent of element from the input iterable

Leave a comment