I think learning pad function may be helpful and it is more dynamic `A=numpy.zeros([4,4])` `print(numpy.pad(A,(1,1),"constant",constant_values=1))`