How to use List.CartesianProduct at @L3

Hello Dynamo community,

I’m facing a situation that need to use node CartesianProduct at @L3 as below images.

It should be ListA[0] match to ListB[0] then run CartesianProduct node in that new list(like the second image), then ListA[1] ,B[1] then run CartesianProduct node and so on.

I still don’t figure it out so far. So any help would be appreciated.
Thank you for your time!

1 Like

import itertools

elements = []

for i in itertools.product([1, 2, 3],['a', 'b'],[4,5]):
    elements.append(i)
    
OUT = elements

hello,

how to deal with that … hmmm
You can flatten at @2

KR

Andreas

1 Like