Build the rows
The outer counter x decreases from 5 to 1, and its value determines both the padding and sequence start.
The rows read 54321, 4321, 321, 21, and 1, with each shorter line shifted right.
The outer counter x decreases from 5 to 1, and its value determines both the padding and sequence start.
The inner counter z runs from x down to 1, printing a descending sequence on every row.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.