摘要: 并行迭代 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) 推荐(0) 编辑
摘要: from collections import Iteratorclass IterA(Iterator): def __init__(self,Itlist): self.Itlist = Itlist self.index = 0 def next(self): if self.index == 阅读全文
posted @ 2018-07-05 20:59 破晓e 阅读(73) 评论(0) 推荐(0) 编辑