Build the rows
The outer loop creates nine rows, and the middle column position px moves outward on each half of the shape.
The X-shaped diagonals are labeled by their moving column position as they travel toward and away from the center.
The outer loop creates nine rows, and the middle column position px moves outward on each half of the shape.
At either matching diagonal column, the code prints px; the rest of the grid is filled with spaces.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.