Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to find a combination of all elements in a python list

import itertools

stuff = [1, 2, 3]
for L in range(0, len(stuff)+1):
    for subset in itertools.combinations(stuff, L):
        print(subset)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #combination #elements #python #list
ADD COMMENT
Topic
Name
1+1 =