Python Inverted Spaced Repeated-Number Triangle (Pattern 70)

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

Output:

Output of the Python Inverted Spaced Repeated-Number Triangle pattern
BEGINNER WALKTHROUGH

How the Inverted Spaced Repeated-Number Triangle works

Rows repeat 5, 4, 3, 2, and 1 with decreasing counts and increasing indentation.

01

Build the rows

The outer counter x counts down and supplies the repeated number; a second loop moves the row right.

02

Choose what each row prints

The inner loop prints x followed by a space, repeating it x times on the current line.

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.