import random
#定义学校和办公室
school=[[],[],[]]
#定义列表保存老师
def teacher():
teacher_list=[]
index=1
while index<=8:
teacher_name='老师'+str(index)
teacher_list.append(teacher_name)
index+=1
return teacher_list
teacher_list=teacher()
#随机分配老师
for teacher in teacher_list:
office=random.randint(0,2)
school[office].append(teacher)
#查看各办公室老师
for office in school:
for person in office:
print(person,end=' ')
print()