python 迭代多个对象

并行迭代  zip

for a,b,c in zip(list,list,tuple,list):

  print a,b,c

 

串行迭代  itertools.chain

a = [1,2,3,4,5]

b = [2,3,4,5,6]

for x in chain(a,b):

  print x

posted @ 2018-07-05 21:35  破晓e  阅读(130)  评论(0编辑  收藏  举报