itertools
强大的迭代的工具包 官方文档 https://docs.python.org/2/library/itertools.html?highlight=itertools#module-itertools
主要的函数:
count() : 如 count(10) 是从10 开始往下一直无限的迭代下去
cycle() : 如 cycle ('abcd') 将a b c d a b c d 一直这样无限的迭代下去
repeat() : 如 repeat(10,3) 将 10 迭代 3次
groupby(): 将传入的参数中的重复的元素提取出来
chain(): 将传入的参数进行合并迭代 ,如 chain("abc" ," def") --> a b c d e f
腾飞前的蛰伏

浙公网安备 33010602011771号