I want my function to divide a random list of students into groups according to a given size (Z). Student(X,Y) is a function that removes all students in group X that are also in group Y, but that is unimportant for this question.
A given input can be random_teams(S,T,[6,5,4]) With this function I want to create groups of size 6, 5 and 4. Thus I want to iterate over this list. Nevertheless, it only returns a list with 6 elements, and does not give me a list with the remaining 5 and 4.
def random_teams(X,Y,Z):
l = random.sample(student(X,Y), len(student(X,Y)))
for i in Z:
return l[:i]
l = l[i:]