import random
for i inrange(10):print(random.randint(1,5))for i inrange(10):print(random.randrange(1,5))
x =[1,2,3,4,5]for i inrange(10):print(random.choice(x))# 观察下面的0和1的比例for i inrange(10):print(random.choices([0,1], k=6))for i inrange(10):print(random.choices([0,1],[10,1], k=6))# 10比1权重
x =[1,2,3,4,5]# 采样for i inrange(5):print(random.sample(x,5))# k不能是6