首页 Python python random.shuffle的随机性

python random.shuffle的随机性

以下是来自 python网站,关于 random.shuffle(x[, random]) Shuffle the sequence x in place. The optional argument random is a 0-argument function returning a random float in [0.0, 1.0); by default, this is the fun

以下是来自
python网站,关于

random.shuffle(x[,random])

Shuffle the sequence x in place. The optional argument random is a 0-argument function returning a random float in [0.0,1.0); by default,this is the function random().

Note that for even rather small len(x),the total number of permutations of x is larger than the period of most random number generators; this implies that most permutations of a long sequence can never be generated.

如果我想重复获得[‘a’…’k’]的随机排列,似乎随机播放不会给我随机性.我的理解是对的吗?

谢谢!

解决方法

You don’t have anything to worry about.在len(x)下,2000年以下,random.shuffle应该可以正常工作.

本文来自网络,不代表青岛站长网立场。转载请注明出处: https://www.0532zz.com/html/kaifa/python/20201230/13983.html
上一篇
下一篇

作者: dawei

【声明】:青岛站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

返回顶部