# Python Program to Split a List Into Evenly Sized Chunks

# Method 1 using yield
def split(list_a, chunk_size):

    for i in range(0, len(list_a), chunk_size):
        yield list_a[i:i + chunk_size]

chunk_size = 2
my_list = [1,2,3,4,5,6,7,8,9]
print(list(split(my_list, chunk_size)))

# Method 2 using numpy
# import numpy as np

# my_list = [1,2,3,4,5,6,7,8,9]
# print(np.array_split(my_list, 5))
