📜  来自2个数组的所有排列python代码示例

📅  最后修改于: 2022-03-11 14:45:28.808000             🧑  作者: Mango

代码示例1
>>> 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