Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

all permutation from 2 arrays python

>>> import itertools
>>> a = ['foo', 'bar', 'baz']
>>> b = ['x', 'y', 'z', 'w']

>>> for r in itertools.product(a, b): print r[0] + r[1]
foox
fooy
fooz
foow
barx
bary
barz
barw
bazx
bazy
bazz
bazw
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #permutation #arrays #python
ADD COMMENT
Topic
Name
9+4 =