dn wrote:
On 22/05/24 07:14, HenHanna via Python-list wrote:
How can i write this function Cprod (Cartesian Product) simply?
(writing this out: itertools.product([0, 1], repeat=N
)
The value can be a list or a Tuple.
cprod([0, 1], 1) => ((0) (1))
On 22/05/24 07:14, HenHanna via Python-list wrote:
How can i write this function Cprod (Cartesian Product) simply?
(writing this out: itertools.product([0, 1], repeat=N )
The value can be a list or a Tuple.
cprod([0, 1], 1) => ((0) (1))
How can i write this function Cprod (Cartesian Product) simply?
(writing this out: itertools.product([0, 1], repeat=N )
The value can be a list or a Tuple.
cprod([0, 1], 1) => ((0) (1))
cprod([0, 1], 2) => ((0,0) (0,1) (1,0) (1,1))
This