Build the rows
The outer loop counts down from 5 to 1. Its companion loop adds one more leading space as the row shrinks.
Five stars begin at the left, and each following row is shorter and shifted farther right.
The outer loop counts down from 5 to 1. Its companion loop adds one more leading space as the row shrinks.
The star loop runs x times, so the visible row lengths decrease from five to one.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.