On Mon, Jul 11, 2011 at 10:39 PM, David <davidb...@gmail.com> 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: http://docs.python.org/faq/programming.html#how-do-i-create-a-multidimensional-list Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list