I'm trying to insert a list of number into a list of list. I've simplified the code just as an example because the actual thing is fairly long. Basically i have two list and the end result i want is as follows:
C = [
[1,1,x],
[2,1,x],
[3,1,x],
[1,2,x],
[2,2,x],
[3,2,x],
[1,3,x],
[2,3,x],
[3,3,x],
]
You can think of this as a matrix of nxn dimensions, but the list has to be like this. Basically my problem is that i can't figure out how to insert the first list into index 0 and 1 like in the matrix above. The second list is just the x's at index 3 which i can work my way around.
Here is what i have so far, any help would be appreciated. Thanks a lot!!
set_I = [1,2,3]
set_J = [x,x,x,x,x,x,x,x,x]
C = []
for i in range(len(set_I)*len(set_I)):
C.append([])
for liste in C:
liste.insert(0,0)
liste.insert(1,0)
liste.insert(2,0)