赞
踩
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)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。