[Python] itertools function of the product

[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 in for 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)

 

 

 

 

Guess you like

Origin www.cnblogs.com/xxxxxxxxx/p/11544432.html