Given two lists, I want to merge them so that all elements from the first list are even-indexed (preserving their order) and all elements from second list are odd-indexed (also preserving their order). Example below:
x = [0,1,2]
y = [3,4]
result = [0,3,1,4,2]
I can do it using for loop. But I guess there could be a fancy pythonic way of doing this (using a less-known function or something like that). Is there any better solution that writing a for-loop?
edit: I was thinking about list comprehensions, but didn't come up with any solution so far.