python random.shuffle的随机性

python random.shuffle的随机性,第1张

概述以下是来自 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应该可以正常工作. 总结

以上是内存溢出为你收集整理的python random.shuffle的随机性全部内容,希望文章能够帮你解决python random.shuffle的随机性所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1207072.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存