[Reserved] source blog
product
A plurality of request iterables Cartesian product (Cartesian Product), with its equivalent i.e. nested for loop:
product(A, B)
with ((x,y) for x in A for y in B)的效果是一样的。
Use the form below:
itertools.product(*iterables, repeat=1)
iterables is iterables , REPEAT designated iterable repeated several times , namely:
product (A, repeat = 3) is equivalent to the product (A, A, A)