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.