<small id='dNkul'></small><noframes id='dNkul'>

  • <legend id='dNkul'><style id='dNkul'><dir id='dNkul'><q id='dNkul'></q></dir></style></legend>

    1. <tfoot id='dNkul'></tfoot>
        <bdo id='dNkul'></bdo><ul id='dNkul'></ul>

        <i id='dNkul'><tr id='dNkul'><dt id='dNkul'><q id='dNkul'><span id='dNkul'><b id='dNkul'><form id='dNkul'><ins id='dNkul'></ins><ul id='dNkul'></ul><sub id='dNkul'></sub></form><legend id='dNkul'></legend><bdo id='dNkul'><pre id='dNkul'><center id='dNkul'></center></pre></bdo></b><th id='dNkul'></th></span></q></dt></tr></i><div id='dNkul'><tfoot id='dNkul'></tfoot><dl id='dNkul'><fieldset id='dNkul'></fieldset></dl></div>
      1. 无限范围()

        时间:2023-11-08
      2. <tfoot id='9Ssfn'></tfoot>

        <small id='9Ssfn'></small><noframes id='9Ssfn'>

            <tbody id='9Ssfn'></tbody>

              <bdo id='9Ssfn'></bdo><ul id='9Ssfn'></ul>
            • <i id='9Ssfn'><tr id='9Ssfn'><dt id='9Ssfn'><q id='9Ssfn'><span id='9Ssfn'><b id='9Ssfn'><form id='9Ssfn'><ins id='9Ssfn'></ins><ul id='9Ssfn'></ul><sub id='9Ssfn'></sub></form><legend id='9Ssfn'></legend><bdo id='9Ssfn'><pre id='9Ssfn'><center id='9Ssfn'></center></pre></bdo></b><th id='9Ssfn'></th></span></q></dt></tr></i><div id='9Ssfn'><tfoot id='9Ssfn'></tfoot><dl id='9Ssfn'><fieldset id='9Ssfn'></fieldset></dl></div>

                1. <legend id='9Ssfn'><style id='9Ssfn'><dir id='9Ssfn'><q id='9Ssfn'></q></dir></style></legend>
                  本文介绍了无限范围()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Is there an unbounded version of range (or xrange for Python 2), or is it necessary to define it manually? For example

                  squares = (x*x for x in range(n))
                  

                  can only give me a generator for the squares up to (n-1)**2, and I can't see any obvious way to call range(infinity) so that it just keeps on truckin'.

                  解决方案

                  You're describing the basic use of itertools.count:

                  import itertools
                  squares = (x*x for x in itertools.count())
                  

                  这篇关于无限范围()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何检查当前时间是否在python的范围内? 下一篇:只需要索引:枚举还是(x)范围?

                  相关文章

                2. <small id='8lPXW'></small><noframes id='8lPXW'>

                  • <bdo id='8lPXW'></bdo><ul id='8lPXW'></ul>

                  <i id='8lPXW'><tr id='8lPXW'><dt id='8lPXW'><q id='8lPXW'><span id='8lPXW'><b id='8lPXW'><form id='8lPXW'><ins id='8lPXW'></ins><ul id='8lPXW'></ul><sub id='8lPXW'></sub></form><legend id='8lPXW'></legend><bdo id='8lPXW'><pre id='8lPXW'><center id='8lPXW'></center></pre></bdo></b><th id='8lPXW'></th></span></q></dt></tr></i><div id='8lPXW'><tfoot id='8lPXW'></tfoot><dl id='8lPXW'><fieldset id='8lPXW'></fieldset></dl></div>

                    1. <legend id='8lPXW'><style id='8lPXW'><dir id='8lPXW'><q id='8lPXW'></q></dir></style></legend><tfoot id='8lPXW'></tfoot>