让学生与其他学生配对
答
这听起来像itertools可能会有所帮助!
from itertools import combinations
students = ["Tom","Jeff","Mary"]
schedule = list(combinations(students,2))
希望这有助于!
+0
感谢您的建议,但这并不能确保一个学生不会被要求每个会话与多个人见面。我需要确保所有14名学生每次只与另一名学生见面。那有意义吗? – nickculber
请提供可重复性最低的代码。 –