Build the rows
The outer counter x counts down from 5 to 1 and supplies the digit for each row.
The rows show five 5s, four 4s, three 3s, two 2s, and one 1.
The outer counter x counts down from 5 to 1 and supplies the digit for each row.
The inner loop runs x times and prints x, so both the repeated digit and 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.