07 2018 档案
摘要:并行迭代 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
阅读全文
摘要:from collections import Iteratorclass IterA(Iterator): def __init__(self,Itlist): self.Itlist = Itlist self.index = 0 def next(self): if self.index ==
阅读全文
摘要:a = (zhangsan,20,nv,123@163.com) 输出姓名 a[0] 输出年龄 a[1] 输出性别 a[2] ..... 这样写可读性非常低 使用 内置元祖子类 from collections import namedtuple Item = namedtuple('class_n
阅读全文
摘要:1、 __init__.py 2、模块1 模块2 3、setup.py
阅读全文

浙公网安备 33010602011771号