每天CookBook之Python-068

  • 将序列链接
from itertools import chain

a = [1, 2, 3]
b = ['x', 'y', 'z']

for x in chain(a, b):
    print(x)

out

1
2
3
x
y
z
posted @ 2016-07-22 21:12  4Thing  阅读(92)  评论(0编辑  收藏  举报