Python Twin-Pyramid Pattern with Spaced Stars (Pattern 100)

Python Code
ph = 5  # height
ps = ph - 1  # space
inc = 1

for x in range(0, ph):
    for y in range(ps, x, -1):
        print(" ", end="")
    for z in range(0, x + 1):
        print("* ", end="")

    for y in range(ph + ph - 2, inc - 1, -1):
        print(" ", end="")
    for z in range(0, x + 1):
        print("* ", end="")

    inc += 2
    print()

Output:

Output of the Python Twin-Pyramid Pattern with Spaced Stars pattern
BEGINNER WALKTHROUGH

How the Twin-Pyramid Pattern with Spaced Stars works

Two centered star groups grow on each row, with a narrowing gap between their arms.

01

Build the rows

The outer loop runs once per height level; leading and middle spaces position the two growing star groups.

02

Choose what each row prints

Each side prints x + 1 copies of "* ", while the central gap is controlled by inc and shrinks as inc increases.

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.