Answer the question
In order to leave comments, you need to log in
Creating and populating a 2D array with elements of an existing array?
i have array [1,2,3,4,5,6,7,8,9] and i want to get
how to implement this?
Answer the question
In order to leave comments, you need to log in
a = [1,2,3,4,5,6,7,8,9]
[a[i*3:i*3+3] for i in range(len(a)//3)]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question