Python Inverted Spaced Star Triangle (Pattern 69)

Python Code
for x in range(5, 0, -1):
    for y in range(x, 5):
        print(" ", end="")
    for z in range(0, x):
        print("* ", end="")
    print()

# Another Logic

for x in range(5, 0, -1):
    for y in range(5, 0, -1):
        if x >= y:
            print("* ", end="")
        else:
            print(" ", end="")
    print()

Output:

Output of the Python Inverted Spaced Star Triangle pattern
BEGINNER WALKTHROUGH

How the Inverted Spaced Star Triangle works

The first row has five spaced stars; each following row is shorter and shifted farther right.

01

Build the rows

The outer loop counts down from 5, while the padding loop adds spaces as the rows narrow.

02

Choose what each row prints

The inner loop prints x copies of "* ", so both the star count and row width decrease.

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.