Answer
[[[1, 1, 1]], [[1, 1, 1]], [[1, 1, 1]]]
[3, [[1, 1, 1]], [[1, 1, 1]]]
Work Step by Step
matrix = []
matrix.append([3 * [1]])
matrix.append([3 * [1]])
matrix.append([3 * [1]])
print(matrix)
matrix[0] = 3
print(matrix)
The output of the code will be:
[[[1, 1, 1]], [[1, 1, 1]], [[1, 1, 1]]]
[3, [[1, 1, 1]], [[1, 1, 1]]]