Print a array of size n*n, with borders as 1's and fill rest of element with 0's
Have you alread checked out np.pad?
import numpy as np
n = int(input(&quot;Enter a number:&quot;))
np_box = np.pad(np.zeros((n-1,n-1)), 1, constant_values=1)