Python Left-Aligned Star Diamond (Pattern 54)

Python Code
size = 3
for x in range(size, -(size + 1), -1):
    for y in range(size, abs(x) - 1, -1):
        print("*", end="")
    print()

Output:

Output of the Python Left-Aligned Star Diamond pattern
BEGINNER WALKTHROUGH

How the Left-Aligned Star Diamond works

The row widths grow from one to four stars and then shrink back to one.

01

Build the rows

The outer x counter moves from 3 through zero and back to negative values, giving the pattern its two halves.

02

Choose what each row prints

The inner loop prints size - abs(x) + 1 stars on each row; there is no leading-space loop, so the rows stay left-aligned.

03

Keep the output aligned

The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.