笛卡尔积:itertools.product(*iterables[, repeat]) 1 2 3 4 5 6 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 两个元组进行笛卡尔积: 1 2 3 4 5 6 7 8 import itertools a = (1, 2) b = ('A', 'B', 'C') c = itertools.product(a,b) fo