Write a Python program to Break a list into chunks of size N in Python
Topic: Write a Python program to Break a list into chunks of size N in Python
Solution
l = [1, 2, 3, 4, 5, 6, 7, 8, 9] n = 4 x = [l[i:i + n] for i in range(0, len(l), n)] print(x)
List all Python Programs