Lists of lists python 递归排列
Lists of lists python recursive permutation
如何以特定方式操作字符串列表,以便
lst = [ [a, b], [c, d, e], [f, a, e] ]
# turns into
lst = [ [a, b], [b, a], [c, d, e], [c, e, d], [d, c, e],etc...]
#there are 14 combinations
from itertools import *
combo_list = []
for i in your_list:
for j in permutations(i, len(i)):
combo_list.append(j)
如何以特定方式操作字符串列表,以便
lst = [ [a, b], [c, d, e], [f, a, e] ]
# turns into
lst = [ [a, b], [b, a], [c, d, e], [c, e, d], [d, c, e],etc...]
#there are 14 combinations
from itertools import *
combo_list = []
for i in your_list:
for j in permutations(i, len(i)):
combo_list.append(j)