Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
a = ['one', 'two', None, 'four', None] b = [None, None, 'three', None, 'five']
a = ['one', 'two', 'three', 'four', 'five']
from itertools import zip_longest a = ['one', 'two', None, 'four', None] b = [None, None, 'three', None, 'five'] # если списки 100% одинаковой длины можно просто zip использовать c = [x or y for x, y in zip_longest(a, b)] print(c)