Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here's a python solution.

from random import shuffle
a=['a','b','c','d','e','f','g','h','i','j','k','l']
n=len(a)/6
shuffle(a)
results=[[a[i] for i in range(j*6,j*6+6)] for j in range(0,n)]
results
click to hide/show revision 2
corrected wording; misread original problem statement

Here's a python solution.way to shuffle students into groups in python. It's not a solution to the problem you've posed, but it's a start.

from random import shuffle
a=['a','b','c','d','e','f','g','h','i','j','k','l']
n=len(a)/6
shuffle(a)
results=[[a[i] for i in range(j*6,j*6+6)] for j in range(0,n)]
results