Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python combinations function

def combinations(iterable, r):
    pool = tuple(iterable)
    n = len(pool)
    for indices in permutations(range(n), r):
        if sorted(indices) == list(indices):
            yield tuple(pool[i] for i in indices)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #combinations #function
ADD COMMENT
Topic
Name
8+7 =