• <legend id='q3IA4'><style id='q3IA4'><dir id='q3IA4'><q id='q3IA4'></q></dir></style></legend>
    <tfoot id='q3IA4'></tfoot>

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

    • <bdo id='q3IA4'></bdo><ul id='q3IA4'></ul>

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

        随机模块不工作.ValueError:randrange() 的空范围 (1,1, 0)

        时间:2023-07-02

          1. <small id='prnLS'></small><noframes id='prnLS'>

            <legend id='prnLS'><style id='prnLS'><dir id='prnLS'><q id='prnLS'></q></dir></style></legend>
                  <tbody id='prnLS'></tbody>
                <i id='prnLS'><tr id='prnLS'><dt id='prnLS'><q id='prnLS'><span id='prnLS'><b id='prnLS'><form id='prnLS'><ins id='prnLS'></ins><ul id='prnLS'></ul><sub id='prnLS'></sub></form><legend id='prnLS'></legend><bdo id='prnLS'><pre id='prnLS'><center id='prnLS'></center></pre></bdo></b><th id='prnLS'></th></span></q></dt></tr></i><div id='prnLS'><tfoot id='prnLS'></tfoot><dl id='prnLS'><fieldset id='prnLS'></fieldset></dl></div>
                <tfoot id='prnLS'></tfoot>
                • <bdo id='prnLS'></bdo><ul id='prnLS'></ul>
                • 本文介绍了随机模块不工作.ValueError:randrange() 的空范围 (1,1, 0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Python 2.7.1 中,我导入随机模块.但是,当我调用 randint() 时,出现错误:

                  In Python 2.7.1, I import the random module. when I call randint() however, I get the error:

                  ValueError: empty range for randrange() (1,1, 0) 
                  

                  此错误是由 random.py 模块本身的错误引起的.我不知道如何修复它,重新安装python帮助也不知道.我无法更改版本.

                  This error is caused by an error in the random.py module itself. I don't know how to fix it, not does reinstalling python help. I can't change versions.

                  谁能给我一个工作模块的代码或告诉我该怎么做?

                  can someone please give me code for a working module or tell me what to do?

                  推荐答案

                  你这样调用randint:

                  You called randint like this:

                   randint(1,0)
                  

                  这告诉 randint 返回一个从 1 到 0 的值.从 1 到 0 的数字范围肯定是一个空范围.因此错误:

                  That tells randint to return a value starting as 1 and ending at 0. The range of numbers from 1 to zero is as you surely realize an empty range. Hence the error:

                   empty range for randrange()
                  

                  这篇关于随机模块不工作.ValueError:randrange() 的空范围 (1,1, 0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何从文本“1m"中进行变量更改?变成“1000000"在蟒蛇 下一篇:为什么'decimal.Decimal(1)'不是'numbers.Real'的一个实例

                  相关文章

                  <legend id='HriXV'><style id='HriXV'><dir id='HriXV'><q id='HriXV'></q></dir></style></legend>

                  1. <tfoot id='HriXV'></tfoot>
                  2. <small id='HriXV'></small><noframes id='HriXV'>

                      <bdo id='HriXV'></bdo><ul id='HriXV'></ul>

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