Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

all permutation from 2 arrays python


>>> import itertools
>>> map(''.join, itertools.chain(itertools.product(list1, list2), itertools.product(list2, list1)))
['squarered', 'squaregreen', 'circlered',
'circlegreen', 'trianglered', 'trianglegreen',
'redsquare', 'redcircle', 'redtriangle', 'greensquare',
'greencircle', 'greentriangle']

Source by devarama.com #
 
PREVIOUS NEXT
Tagged: #permutation #arrays #python
ADD COMMENT
Topic
Name
8+4 =