Build the rows
The outer loop crosses zero, so abs(x) decreases toward the center and increases again afterward.
Leading spaces and changing star counts create a centered diamond that grows and then narrows.
The outer loop crosses zero, so abs(x) decreases toward the center and increases again afterward.
One inner loop prints abs(x) spaces; the next prints the matching number of stars needed for each half of the shape.
The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.