import random
office = [[], [], []]
teacher = ['t1', 't2', 't3', 't4', 't5', 't6', 't7', 't8']
for t in teacher:
    of = random.randint(0, 2)
    office[of].append(t)
print(office)
i = 0
for x in office:
    i += 1
    print('第%d个办公室有%d个人,是:' % (i, len(x)), end='')
    for n in x:
        print(n, end='\t')
    print('\n')

  

相关文章:

  • 2021-04-22
  • 2021-10-12
  • 2021-04-09
  • 2021-10-12
  • 2021-12-24
  • 2021-09-23
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2021-06-24
相关资源
相似解决方案