split_into_groups#

split_into_groups(lst, num_groups)[source]#

Attempts to split a list into a given number of groups. The number of groups will be at least 1 and at most num_groups.

Parameters
  • lst – The list to split

  • num_groups – The number of groups to create.

Returns

A list of size between 1 and num_groups containing lists of items of l.