Python随机模块函数依赖于伪随机数生成器函数random(), 该函数生成介于0.0和1.0之间的浮点数。
随机模块中使用的功能类型不同, 如下所示:
random.random()
此函数生成介于0.0到1.0之间的随机浮点数。
random.randint()
此函数返回指定整数之间的随机整数。
random.randrange()
此函数从start, stop和step参数创建的范围内返回一个随机选择的元素。默认情况下, start的值为0。
random.choice()
此函数从非空序列返回随机选择的元素。
random.shuffle()
此功能随机重新排列列表中的元素。
来源:
https://www.srcmini02.com/31216.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_35560.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57