Build the rows
The outer counter x counts down and supplies the repeated digit; a second loop adds the left padding.
The rows contain five 5s, four 4s, down to one 1, with each shorter row shifted right.
The outer counter x counts down and supplies the repeated digit; a second loop adds the left padding.
The last inner loop prints x copies, so both the digit and the row width decrease together.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.