生成不相同的随机数

import random

random.sample()生成不相同的随机数

list = random.sample(range(1,100),10)
print(list)
这三行程序功能:在1-100之间产生不相同的10个随机数。

猜你喜欢

转载自blog.csdn.net/weixin_44538696/article/details/89189295