Build the rows
The outer loop grows x from 1 to 5. A first inner loop prints fewer leading spaces as the row gets longer.
Leading spaces shift each growing row of stars to the right, creating a staircase-shaped triangle.
The outer loop grows x from 1 to 5. A first inner loop prints fewer leading spaces as the row gets longer.
A second inner loop prints x stars, then the line break starts the next row.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.