当前位置: 移动技术网 > IT编程>脚本编程>Python > 列表联系(回炉练习)

列表联系(回炉练习)

2018年07月22日  | 移动技术网IT编程  | 我要评论

c语言,胎心率正常值,中国的秘密 王思聪

__author__ = 'zht'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
#努力学习每一天
'''

import  random

offices = [[],[],[]]

names = ['A','B','C','D','E','F','G','H']

i = 1

for name in names:
    index = random.randint(0,2)
    offices[index].append(name)
print(offices)

for temp in offices:
    print("办公室%d的人数为%d"%(i,len(temp)))

    for name in temp:
        print("%s"%(name),end=',')
    i+= 1
    print("\n")

  

#某个学校,有3个办公室,现在有8位老师等待工位的分配,请编写程序,完成随机的分配

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网