Build the rows
The outer loop scans a nine-by-nine grid; px tracks the changing diagonal columns around the center.
The two diagonals form an X and carry row values that increase toward the center, then decrease.
The outer loop scans a nine-by-nine grid; px tracks the changing diagonal columns around the center.
Only the diagonal cells print p. The value rises in the top half and falls in the bottom half, while other cells print spaces.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.