<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Python 生成隨機數 > 原文: [https://thepythonguru.com/python-generating-random-numbers/](https://thepythonguru.com/python-generating-random-numbers/) * * * 于 2020 年 1 月 7 日更新 * * * Python `random`模塊包含生成隨機數的函數。 因此,首先需要使用以下行導入`random`模塊。 ```py import random ``` ## `random()`函數 * * * `random()`函數返回隨機數`r`,使得`0 <= r < 1.0`。 ```py >>> import random >>> for i in range(0, 10): ... print(random.random()) ... ``` **預期輸出**: ```py 0.9240468209780505 0.14200320177446257 0.8647635207997064 0.23926674191769448 0.4436673317102027 0.09211695432442013 0.2512541244937194 0.7279402864974873 0.3864708801092763 0.08450122561765672 ``` `randint(a, b)`生成`a`和`b`(含)之間的隨機數。 ```py >>> import random >>> for i in range(0, 10): ... print(random.randint(1, 10)) ... 8 3 4 7 1 5 3 7 3 3 ``` 下一章將介紹 python 中的[文件處理技術](/python-file-handling/)。 * * * * * *
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看