offices = [[],[],[]]
teachers = ["a","b","c","d","e","f","g","h",]
for name in teachers: #就是一种遍历,一个个字母去对应的放进数组
index = random.randint(0,2)
offices[index].append(name)
i = 1
for office in offices:
print("第%d个办公室有%d人"%(i,len(office))) #看i是给谁用的,就放在哪个for循环下面。(盲目换可能导致计数错误)
i += 1
for name in office: #office才是要打印出来的东西(不是offices )
print("%s"%name,end = "\t") #\t:横向跳到下一制表符位置,相当于tap键,8个字符。效果:让每个字母横向排列
print("\r") #\r:回车
print("-"*20) #\n:回车换行