Use nested list comprehensions:

matrix = [[0.0 for x in xrange(n)] for y in xrange(m)]

This is similar to "float matrix[m][n]" in C.

All cells are independent of each other in doing this.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to