Categories
What are the options for merging lists?
There are two lists:
a = ['one', 'two', None, 'four', None] b = [None, None, 'three', None, 'five']
a = ['one', 'two', 'three', 'four', 'five']
Answer the question
In order to leave comments, you need to log in
a = [x or y for x, y in zip(a, b)]
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question