DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+5 =
Submit