python 如何将两个列表按照这个格式形成一个新的列表

需求:
要求将两个列表按照这个格式形成一个新的列表【1,a,2,b,3,c】

方式一

lst1 = [1,2,3]
lst2 = [a,b,c]

a = []
for i,j in zip(lst1, lst2):
    a.append(i)
    a.append(j)
print(a)

方式二

lst1 = [1,2,3]
lst2 = [a,b,c]

a = list(map(lambda x,y: (x,y), lst1, lst2))
print([j for i in a for j in i])

方式三

posted @ 2021-04-01 17:03  大海一个人听  阅读(587)  评论(0编辑  收藏  举报