I am using the following code to build a list of lists:
res = []
for i in I:
res.append(x)
res.append(y[i])
so my final list is [x, y[0], x, y[1],...] where x and y[i] are also lists.
Is there a way building this list using list comprehensions, instead of for loop?
I … think … this might be close to what you want: