If I have an undefined number of lists and I want to write a method to concatenate them in different ways, what would be the best way to do this? So I don’t have only 2 lists, such as list A and list B, and you can write something like
X = [x+y for x, y in zip(A, B)]
but I will have different generated lists that need to be concatenated sequentially, so I don’t know how to iterate over n number of lists and combine them.
The first list will always have one or more elements ( its length may be different ), and those that after it will always contain only one element:
['a','b','c'],['foo'], ['bar']....
As a result i need
['afoobar','bfoobar','cfoobar']