0
49
新手上路
使用道具 举报
阿聪 发表于 2013-12-17 20:17 我用random.sample(range(1,n),m) 分别测试了100,1000。sorted(set(li))排序看结果 没发现重复啊,这个方法 ...
random.sample(population, k) Return a k length list of unique elements chosen from the population sequence. Used for random sampling without replacement.
发表回复 回帖后跳转到最后一页
|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号 )
GMT+8, 2024-5-2 16:42 , Processed in 0.017574 second(s), 24 queries .
Powered by Discuz! X2.5
© 2001-2012 Comsenz Inc.