0. Python中引入itertools 1. 笛卡尔积: product(iter1, iter2,...,iterN,[repeat=i]) from itertools import product #笛卡尔积 #3种常见的iter类型 ',repeat=3): print(x) for x in product([1,0],repeat=3): print(x) for x in product((0,1),repeat=3): print(x) 结果 (') (') (') (')…