import random
def A():
a = []
for i in range(1, 201):
a.append(i)
a1 = set(a)
print(a1)
q=random.sample(a,50)
print("第一班:")
print(q)
A1=set(q)
B1=a1-A1
i=list(B1)
w = random.sample(i,50)
print("第二班:")
print(w)
A2 = set(w)
B2 = B1-A2
j=list(B2)
e = random.sample(j,50)
A3=set(e)
B3=B2-A3
k=list(B3)
print("第三班:")
print(e)
print("第四班:")
print(k)
print(A())
把200人随机分配给四个班(利用集合)
于 2022-10-28 21:43:32 首次发布