python create a matrix with one in diagonal

# Create a matrix in python and fill
import numpy as np
a = np.zeros((3, 3), int) # Create matrix with only 0
np.fill_diagonal(a, 1) # fill diagonal with 1
print(a)

Here is what the above code is Doing:
1. Create a 3×3 matrix of zeros
2. Fill the diagonal with 1
3. Print the matrix