Build the rows
The outer loop covers both halves of the hourglass, and abs(x) determines each row width and its leading spaces.
Every indented row restarts its numbers at 1, growing toward the center and then shrinking.
The outer loop covers both halves of the hourglass, and abs(x) determines each row width and its leading spaces.
The p counter is reset to 1 inside every row, then increases once for each value printed.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.