python | merge two lists alternating code example
Example: python merge two lists alternating
a = [1, 3, 5]
b = [2, 4, 6]
c = []
for x, y in zip(a, b):
c += [x, y]
print(c)
# [1, 2, 3, 4, 5, 6]
a = [1, 3, 5]
b = [2, 4, 6]
c = []
for x, y in zip(a, b):
c += [x, y]
print(c)
# [1, 2, 3, 4, 5, 6]