ar = [[0 for j in range(m)] for i in range(n)]
def list_2D(r, c):
l = []
for i in range(r):
x = [0] * c
l.append(x)
return l
>>> l = [[1, 2, 3], [4, 5, 6], [7], [8, 9]]
>>> sum(l, [])
[1, 2, 3, 4, 5, 6, 7, 8, 9]
length, breadth = x, y
matrix = [[-1 for j in range(breadth)] for i in range(length)]
# every element is -1