import random |
ls1 = [ '老王' , '老李' , '黄老' , '老张' , '老吴' , '赵老' , '周老' , '刘老' ] |
ls2 = [[],[],[]] |
while len (ls1)> 0 : |
a = random.choice(ls1) |
b = random.choice(ls2) |
b.append(a) |
ls1.remove(a) |
i = 1 |
for s in ls2: |
print (f '房间{i}人数为:{len(s)}' ) |
print ("".join(s)) |
i + = 1 |
初级程序员
by: 云代码会员 发表于:2021-11-11 22:49:28 顶(0) | 踩(0) 回复
cvjygiygik
回复评论