Build the rows
The outer loop increases x from 1 to 5, while the preceding loop prints the spaces needed for alignment.
Each row is shifted right and counts from 1 up to its row number.
The outer loop increases x from 1 to 5, while the preceding loop prints the spaces needed for alignment.
The final inner counter z runs from 1 through x, creating prefixes such as 1, 12, and 123.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.