15,846,144 members
See more:
I have two list but i need to join them after another element.

This is the example:

```A = [[1,1,1], [1,0,1], [1,1,1], [1,0,1], [1,0,1]]
B = [[1,1,0], [1,0,1], [1,1,0], [1,0,1], [1,1,0]]```

I need to have a list something like:

```[[1,1,1], [1,1,0], [1,0,1], [1,0,1], [1,1,1], [1,1,0], [1,0,1], [1,0,1], [1,0,1], [1,1,0]]
```

If you dont get it heres an example with variables:

``` A = [a, b, c, d, e]
B = [f, g, h, i, j]<pre>
<pre> [a, f, b, g, c, h, d, i, e, j] ```

What I have tried:

```A = [[1,1,1], [1,0,1], [1,1,1], [1,0,1], [1,0,1]]
B = [[1,1,0], [1,0,1], [1,1,0], [1,0,1], [1,1,0]]

for i in A:
A.append(B)(for i in A[i])```
Posted
Updated 7-Nov-22 4:20am

## Solution 1

Try this:
Python
```res = []
for i in range(len(A)):
res.append(A[i])
res.append(B[i])
print(res)```

But that will only work if A and B are the same length

CPallini 7-Nov-22 9:59am
5.
Richard MacCutchan 7-Nov-22 12:20pm
Thanks. I could not solve it with either list comprehension or zip().
CPallini 8-Nov-22 15:58pm
I tried as well, without success.