Python bug? Indexing to matrices

Chris Rebert clp2 at
Tue Jul 12 01:44:05 EDT 2011

On Mon, Jul 11, 2011 at 10:39 PM, David <davidbtdt at> wrote:
> Should the following line work for defining a matrix with zeros?
> c= [[0]*col]*row
> where "col" is the number of columns in the matrix and "row" is of
> course the number of rows.

Nope. See the FAQ:


More information about the Python-list mailing list