a = [1, 2, 2, 3, 4, 3]
n = 2
list(zip(*[iter(a)]*n))
import numpy as np
np.array(a).reshape(-1, n)
from more_itertools import divide
for n in range(2, 7):
print(f'n: {n} - {[list(x) for x in divide(n=n, iterable=[1, 2, 2, 3, 4, 3])]}\n')
n: 2 - [[1, 2, 2], [3, 4, 3]]
n: 3 - [[1, 2], [2, 3], [4, 3]]
n: 4 - [[1, 2], [2, 3], [4], [3]]
n: 5 - [[1, 2], [2], [3], [4], [3]]
n: 6 - [[1], [2], [2], [3], [4], [3]]
Process finished with exit code 0