发布时间:2025-12-11 02:34:26 浏览次数:2
randint()函数
描述:randint()方法将随机生成一个整数,它在[x,y]范围内 ;有点等价于randrange(x,y+1).
语法
importrandomrandom.randint(x,y)
参数:
x -- 指定范围内的开始值,包含在范围内
y -- 指定范围内的结束值,包含在范围内。
实例演示
>>>printrandom.randrange(5,10);9>>>printrandom.randint(5,10);6
python常用的库:1.requesuts;2.scrapy;3.pillow;4.twisted;5.numpy;6.matplotlib;7.pygama;8.ipyhton等。