def group(sequence, group_length, padding=None):
    if padding is not None:
        sequence += [padding] * (group_length - len(sequence) % group_length)
return [sequence[i:i + group_length] for i in range(0, len(sequence),
    group_length)]
python split string every 3rd value but into a nested format