擅长:python、mysql、java
<p>看看<code>itertools</code>模块。<a href="https://docs.python.org/2/library/itertools.html" rel="nofollow">Documentation here</a></p>
<p><code>itertools.count()</code>会给你自然,永远不会耗尽。<code>itertools.takewhile()</code>将继续使用序列,直到某个指定函数返回<code>True</code>。你知道吗</p>