The code in the question is a nested list comprehension. In Python for example
[x*x for x in range(10)]
returns
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
That syntax means "collect the value of x*x where x is each elements contained in range(10)"
You can of course write also things like
[42 for x in range(10)]
that will give
[42, 42, 42, 42, 42, 42, 42, 42, 42, 42]
(this is exactly the same as above, simply the value x is not used in the expression that you want to collect)
That "list comprehension" is however an expression itself so it can be used in another outer list comprehension... for example
[[x*y for x in range(3)] for y in range(4)]
will return
[[0, 0, 0],
[0, 1, 2],
[0, 2, 4],
[0, 3, 6]]
In the special case of a numeric constant (or any other immutable) you can use a simpler form to build a matrix:
[[0] * 3 for x in range(4)]
that returns
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]
because multiplying a list by an integer n you get a list composed of n copies of the original list concatenated (and so [0]*5 returns [0, 0, 0, 0, 0]).
Note that however the apparently similar
[[0] * 3] * 4
doesn't do the same thing. The reason is that while still displayed as
[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]
in this case the outer list will be composed of 4 references to the same row, not 4 independent rows. This means that after the code
x = [[0] * 3] * 4
x[0][0] = 9
x contains
[[9, 0, 0],
[9, 0, 0],
[9, 0, 0],
[9, 0, 0]]
and not
[[9, 0, 0],
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]
as it would happen with a real matrix composed of independent rows.
[0 for x in xrange(2)] 0is an invalid syntax.