1、count()
>>> import itertools
>>> x = itertools.count(3)
>>> x
count(3)
>>> for i in range(10):
print...5、compress()
根据一个序列的值对另一个序列进行过滤
>>> x = range(1, 20)
>>> x
range(1, 20)
>>> list(x)
[1, 2, 3, 4, 5,...(x, y))
[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]
6、groupby()
根据函数返回值进行分类
>>> def group(v):
if v>10:...(x)
>>> list(itertools.accumulate(x))
[1, 3, 6, 10...(pow, x)
>>> list(itertools.starmap(pow, x))
[32, 9,