Concatenate lists by index

Hello, I am a new user of Dynamo and I get stuck with a problem, hope someone can help me

I would like to concatenate 2 lists by using index as reference

The resulting “+” node should be
In the first list:
1(m) CCE cota = 64,926248 (concatenating the “0” indexes)
2(m) CCE cota = 82,519167 (concatenating the “1” indexes)
3(m) CCE cota = 108,90854 (concatenating the “2” indexes)

In the second list:
1(m) CCE cota = 80,830560 (concatenating the “0” indexes)
2(m) CCE cota = 102,821709 (concatenating the “1” indexes)
3(m) CCE cota = 135,808432 (concatenating the “2” indexes)

Instead, the list only concatenate the first two items with the rest of the first list

Is there a way to fix this?

Thanks in advance

Do you want like this

a = IN[0]
b = IN[1]

c = []
for n in IN[0]:
    for i,j in zip(n,b):
        c.append(j + "-"+ str(i))

n = len(IN[1])

OUT = [c[i * n:(i + 1) * n] for i in range((len(c) + n - 1) // n )]
3 Likes

hi

cordially
christian.stan

5 Likes

That’s exactly what I need, thank you a lot!

1 Like

That’s also a solution for me, thank you for sharing

2 Likes