I want to create for example n matrices like:
m1 = [[0,0],[0,0]]
m2 = [[0,0],[0,0]]
.
.
mn = [[0,0],[0,0]]
I think that will work for you
res = [[[0 for item3 in range(2)] for item2 in range(2)] for item1 in range(10)]
print res
Output:
[
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]],
[[0, 0], [0, 0]]
]
Basically 10(your n value) arrays with 2x2 lists of zeros.
res = [[item for item in range(2)] for item in range(10)]lists of[0, 1], not[0, 0]. It also has the wrong dimensions (10x2 instead of nx2x2).