I have a list of 100 values that i would like to split up to a list with arrays in it were every array holds 10 values.
What I have, for ex:
array = [1,2,3,4,5,6,7,7,8,9,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8............]
What I want, for ex:
newarray = [[0,1,2,3,4,5,6,7,7,8,9],[1,2,3,4,5,6,7,8,9,1],[2,3,4,5,6,7,8............]]
I want to do this so that I can call for newArray[4] and get 10 values.
This is what i have tried:
for i in range(len(values)):
a = []
for j in range(10):
a.append(values[j])
val.append(a)
print(val)
Problem is that i now get all the first ten values in every different array.
What am I doing wrong?