chain模块将两个列表合并

示例代码

from itertools import chain


v1 = [11,22,33]
v2 = ['a','b','c']

for item in chain(v1,v2):
    print(item)

打印输出

11
22
33
a
b
c

 

posted @ 2018-03-07 10:51  Pythia丶陌乐  阅读(216)  评论(0编辑  收藏  举报