def list_of_groups(init_list, children_list_len): list_of_groups = zip(*(iter(init_list),) *children_list_len) end_list = [list(i) for i in list_of_groups] count = len(init_list) % children_list_len end_list.append(init_list[-count:]) if count !=0 else end_list return end_list texts = [(3,4),(5,6),(8,9),(0,2),(5,30),(45,50),(5,6),(8,9),(0,2),(5,30)] split_txt = list_of_groups(texts, 3) print(split_txt)