import numpy as np matrix = np.zeros((10, 10)) matrix[0, :] = 1 matrix[-1, :] = 1 matrix[:, 0] = 1 matrix[:, -1] = 1 print(matrix)
To embed this project on your website, copy the following code and paste it into your website's HTML: