import random offices = [[], [], []] names = ["A", "B", "C", "D", "E", "F", "G", "H"] for name in names: index = random.randint(0, 2) offices[index].append(name) i = 1 for office in offices: print("办公室%d的人数为:%d" % (i, len(office))) i += 1 for name in offices: print("%s" % name, end="t") print("n") print("-"*20)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)