I have tried several ways that are working. But, this one is not.Please help me understand why ?
row, col = 2, 3mat1 = [[None]*col]*rowprint(mat1)for i in range(0, row): for j in range(0, col): mat1[i][j] = int(input())print(mat1)
Input:
123456
Expected:
[[1,2,3], [4,5,6]]
Getting:
[[4,5,6], [4,5,6]]