current_group = []
page_groups = []
group_size = len(names) / num_pages
for group in letter_groups:
    current_group.extend(group)
if len(current_group) > group_size:
    page_groups.append(current_group)
current_group = []
if current_group:
    page_groups.append(current_group)
return page_groups
print(group_names(names, num_pages))
Python: partition list of names into equally sized sublists