“`” <pre><code>import random print(random.random()) # 用于生成一个0到1的随机符点数: 0 <= n < 1.0 print(random.randint(1, 1000)) # 用于生成一个指定范围内的整数 </code></pre> <pre><code> "“` Was this helpful? YesNo 0 / 0 上一篇: 如何使用python删除一个文件? 下一篇: os和sys模块的作用? 发表回复 取消回复0 Your email address will not be published. 在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。