Is there a good way to print n elements of a list, for example 10, after that the next 10 numbers?
liste = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
for i in range(0,len(liste),10):
for j in range(10):
print(liste[j])
This just prints the numbers from 1-10 and begins at 1 again.
I want something like this:
1,2,3,4,5,6,7,8,9,10
11,12,13,14,15,16,17,18,19,20
bassically cut the list into parts of n elements the same size.