I want to concatenate every list in a list with the other list in list. This is what I want: given lists A and B that each have 2 lists inside it, I want to concatenate A[0]+B[0], A[0]+B[1], A[1]+B[0], A[1]+B[1]. I have written a simple code below:
def concatenate(seq1, seq2):
for i in range(len(seq1)):
for j in range(len(seq2)):
return seq1[i] + seq2[j]
When I put [[1,2],[3,4]],[[2,3],[4,5]] as an argument, I want [[1,2,2,3], [1,2,4,5], [3,4,2,3], [3,4,4,5]] as a result but I'm only getting [1,2,2,3] at the moment. Is there a method to fix this?