xRange = 4
yRange = 3
baseList = []
values = []
count = 0
#make a list of 100 values
for i in range(100):
values.append(i)
#add 4 lists to base list
for x in range(xRange):
baseList.append([])
#at this point i have [[], [], [], []]
#add 3 values to all 4 lists
for x in range(xRange):
for y in range(yRange):
baseList[x].append(values[count])
count += 1
print baseList
#the result i'm expecting is:
#[[0,1,2], [3,4,5], [6,7,8], [9,10,11]]
eFJhbmdlID0gNAp5UmFuZ2UgPSAzCmJhc2VMaXN0ID0gW10KdmFsdWVzID0gW10KY291bnQgPSAwCgojbWFrZSBhIGxpc3Qgb2YgMTAwIHZhbHVlcwpmb3IgaSBpbiByYW5nZSgxMDApOgogICAgdmFsdWVzLmFwcGVuZChpKQoKI2FkZCA0IGxpc3RzIHRvIGJhc2UgbGlzdApmb3IgeCBpbiByYW5nZSh4UmFuZ2UpOgogICAgYmFzZUxpc3QuYXBwZW5kKFtdKQojYXQgdGhpcyBwb2ludCBpIGhhdmUgW1tdLCBbXSwgW10sIFtdXQoKI2FkZCAzIHZhbHVlcyB0byBhbGwgNCBsaXN0cwpmb3IgeCBpbiByYW5nZSh4UmFuZ2UpOgogICAgICAgIGZvciB5IGluIHJhbmdlKHlSYW5nZSk6CiAgICAgICAgICAgIGJhc2VMaXN0W3hdLmFwcGVuZCh2YWx1ZXNbY291bnRdKQogICAgICAgICAgICBjb3VudCArPSAxCgpwcmludCBiYXNlTGlzdAoKI3RoZSByZXN1bHQgaSdtIGV4cGVjdGluZyBpczoKI1tbMCwxLDJdLCBbMyw0LDVdLCBbNiw3LDhdLCBbOSwxMCwxMV1dCg==
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]]