六祎-Python简单的排版表
简单随机的排版工具,开放源代码
四个组,每晚需要两个人值班
import random
team_one = ['王多余', '万人米', '吴小鸿', '爱国国']
team_two = ['丽丽', '爱国国', '孙闯商', '唐强国']
team_three = ['孙强', '江西', '石楠', '名跃']
team_four = ['王虹', '牛丽', '杨涛', '庞涛']
for i in range(2):
for a, b, c, d in zip(random.sample(team_one, 4), random.sample(team_two, 4), random.sample(team_three, 4),
random.sample(team_four, 4)):
print('{}\t{}'.format(a, c))
print('{}\t{}'.format(b, d))
for a, b, c, d in zip(random.sample(team_one, 4), random.sample(team_two, 4), random.sample(team_three, 4),
random.sample(team_four, 4)):
print('{}\t{}'.format(c, a))
print('{}\t{}'.format(d, b))