itertools模块 islice的用法

islice(iterable, [start, ] stop [, step]):
创建一个迭代器: iterable[start : stop : step],跳过前start个项,迭代在stop所指定的位置停止,step指定用于跳过项的步幅。迭代默认将从0开始,步幅默认1

用python快速写斐波那契数列(延迟计算:生成器表达式,仅在需要计算的时候才通过yield产生所需的元素):

原文地址:https://www.cnblogs.com/sylarwang/p/11857278.html