如何以特定方式操作字符串列表以便
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
答案 0 :(得分:2)
from itertools import *
combo_list = []
for i in your_list:
for j in permutations(i, len(i)):
combo_list.append(j)