Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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]
 
PREVIOUS NEXT
Tagged: #python #merge #lists #alternating
ADD COMMENT
Topic
Name
4+2 =