Answers for "python permutations of two lists"

1

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
Posted by: Guest on September-03-2021

Code answers related to "python permutations of two lists"

Python Answers by Framework

Browse Popular Code Answers by Language