Build the rows
The outer x counter moves from 3 through zero and back to negative values, giving the pattern its two halves.
The row widths grow from one to four stars and then shrink back to one.
The outer x counter moves from 3 through zero and back to negative values, giving the pattern its two halves.
The inner loop prints size - abs(x) + 1 stars on each row; there is no leading-space loop, so the rows stay left-aligned.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.