Build the rows
The outer loop counts down from 6 to 2; using x - 1 as the inner endpoint removes one value each row.
Each row counts up from 1, while the row lengths shrink from five values to one.
The outer loop counts down from 6 to 2; using x - 1 as the inner endpoint removes one value each row.
The inner counter y always begins at 1, so the rows are prefixes such as 12345, 1234, and 123.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.