1o=[]
2for i in range(0,rows):
3 x=[]
4 for j in range(0,cols):
5 x.append(0)
6 o.append(x)
7#if you use [[0]*cols]*rows all rows will become the same list
8#so editing in one row will edit all rows
1length, breadth = x, y
2matrix = [[-1 for j in range(breadth)] for i in range(length)]
3# every element is -1