Square Pattern In Python Using Global Variables