Build the rows
The outer counter x counts down and supplies the repeated number; a second loop moves the row right.
Rows repeat 5, 4, 3, 2, and 1 with decreasing counts and increasing indentation.
The outer counter x counts down and supplies the repeated number; a second loop moves the row right.
The inner loop prints x followed by a space, repeating it x times on the current line.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.