# test permutations and combinations import itertools as it for i in it.combinations('abcd',2): print (i) for j in it.combinations('123456',4): print (j) for k in it.permutations('ABCDEF',2): print (k) for m in it.product('ZXY','1234'): print (m) lis…
笛卡尔积:itertools.product(*iterables[, repeat]) import itertools for i in itertools.product('BCDEF', repeat = 2): print(''.join(i),end=",") print('\n') # 输出 BB BC BD BE BF CB CC CD CE CF DB DC DD DE DF EB EC ED EE EF FB FC FD FE FF 两个元组进行笛卡尔积: impo…