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

  • <i id='iKDlL'><tr id='iKDlL'><dt id='iKDlL'><q id='iKDlL'><span id='iKDlL'><b id='iKDlL'><form id='iKDlL'><ins id='iKDlL'></ins><ul id='iKDlL'></ul><sub id='iKDlL'></sub></form><legend id='iKDlL'></legend><bdo id='iKDlL'><pre id='iKDlL'><center id='iKDlL'></center></pre></bdo></b><th id='iKDlL'></th></span></q></dt></tr></i><div id='iKDlL'><tfoot id='iKDlL'></tfoot><dl id='iKDlL'><fieldset id='iKDlL'></fieldset></dl></div>
    • <bdo id='iKDlL'></bdo><ul id='iKDlL'></ul>
  • <tfoot id='iKDlL'></tfoot>
      1. <legend id='iKDlL'><style id='iKDlL'><dir id='iKDlL'><q id='iKDlL'></q></dir></style></legend>

        Python中13位数字的范围和xrange?

        时间:2023-07-04
        <tfoot id='jh46Z'></tfoot>

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

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

              <tbody id='jh46Z'></tbody>
              <bdo id='jh46Z'></bdo><ul id='jh46Z'></ul>

                  <legend id='jh46Z'><style id='jh46Z'><dir id='jh46Z'><q id='jh46Z'></q></dir></style></legend>
                • 本文介绍了Python中13位数字的范围和xrange?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  range()xrange() 适用于 10 位数字.但是 13 位数字呢?我在论坛中没有找到任何东西.

                  range() and xrange() work for 10-digit-numbers. But how about 13-digit-numbers? I didn't find anything in the forum.

                  推荐答案

                  你可以试试这个.与范围相同的语义:

                  You could try this. Same semantics as range:

                  import operator
                  def lrange(num1, num2 = None, step = 1):
                      op = operator.__lt__
                  
                      if num2 is None:
                          num1, num2 = 0, num1
                      if num2 < num1:
                          if step > 0:
                              num1 = num2
                          op = operator.__gt__
                      elif step < 0:
                          num1 = num2
                  
                      while op(num1, num2):
                          yield num1
                          num1 += step
                  
                  >>> list(lrange(138264128374162347812634134, 138264128374162347812634140))
                  [138264128374162347812634134L, 138264128374162347812634135L, 138264128374162347812634136L, 138264128374162347812634137L, 138264128374162347812634138L, 138264128374162347812634139L]
                  

                  另一个解决方案是使用 itertools.islice,正如 xrange 的 文档

                  Another solution would be using itertools.islice, as suggested inxrange's documentation

                  这篇关于Python中13位数字的范围和xrange?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何将字符串数字转换为列表中的整数? 下一篇:获取Python中整数所需的字节大小

                  相关文章

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

                      <bdo id='QJXnR'></bdo><ul id='QJXnR'></ul>
                    <legend id='QJXnR'><style id='QJXnR'><dir id='QJXnR'><q id='QJXnR'></q></dir></style></legend>
                    1. <tfoot id='QJXnR'></tfoot>

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