Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python combinations

import itertools
def subs(l):
    res = []
    for i in range(1, len(l) + 1):
        for combo in itertools.combinations(l, i):
            res.append(list(combo))
    return res
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #combinations
ADD COMMENT
Topic
Name
7+3 =