Interleaving Lists in Python [duplicate]

Here is a pretty straightforward method using a list comprehension:

>>> lists = [['a', 'b', 'c'], ['d', 'e', 'f']]
>>> [x for t in zip(*lists) for x in t]
['a', 'd', 'b', 'e', 'c', 'f']

Or if you had the lists as separate variables (as in other answers):

[x for t in zip(list_a, list_b) for x in t]

Leave a Comment