How to solve Square and Hollow pattern programs in Python

How to solve Square and Hollow pattern programs in Python