2021-12-02

How to interleave elements from two lists in python

list1 = ["a", "b", "c"]
list2 = [1, 2, 3]

list3 = list1 + list2
print(list3)

output ---

['a', 'b', 'c', 1, 2, 3]

but I want output like this ---

['a',1,'b',2,'c',3]

please help me



from Recent Questions - Stack Overflow https://ift.tt/3lqDAbS
https://ift.tt/eA8V8J

No comments:

Post a Comment