random模块函数

random()随机浮点数,0.0<=x<1.0

randrange(10) 0-9整数

randrange(0,101,2) 0-100偶数

choice(list1) 序列list1中随机选一个

shuffle(list1) 序列西派,改变原序列

sample(list1,k=5) 不改变原序列抽取指定书目样本,并生成新序列

原文地址:https://www.cnblogs.com/icecreate/p/10745960.html