<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. 无限范围()

        Unbounded range()(无限范围())
      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())
                  

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What happens when you compare 2 pandas Series(当你比较 2 个 pandas 系列时会发生什么)
                  Quickly find differences between two large text files(快速查找两个大文本文件之间的差异)
                  Python - Compare 2 files and output differences(Python - 比较 2 个文件和输出差异)
                  Why do comparisions between very large float values fail in python?(为什么在 python 中非常大的浮点值之间的比较会失败?)
                  Dictionary merge by updating but not overwriting if value exists(字典通过更新合并,但如果值存在则不覆盖)
                  Find entries of one text file in another file in python(在python中的另一个文件中查找一个文本文件的条目)
                2. <small id='8lPXW'></small><noframes id='8lPXW'>

                    <tbody id='8lPXW'></tbody>
                    <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>