Merge 3 lists into 1 list

前端 未结 4 488
离开以前
离开以前 2020-12-19 19:25

I want to merge 3 lists in to a single list. For example, I have three lists:

a = [0, 3, 6, 9]
b = [1, 4, 7, 10]
c = [2, 5, 8, 11]

and fina

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 19:49

    import itertools as it
    
    list(it.chain.from_iterable(it.izip(a,b,c)))
    

提交回复
热议问题