Build the rows
The outer loop controls four rows, and its companion loop prints the spaces needed to center each one.
The rows widen to an odd count and mirror values around their row number, for example 1, 121, and 12321.
The outer loop controls four rows, and its companion loop prints the spaces needed to center each one.
The z counter moves across the row in both directions; x - abs(z) produces the matching values on either side.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.