Python Descending Odd-Width Number Pyramid (Pattern 49)

Python Code
decr = 7
for x in range(4, 0, -1):
    for y in range(x, 5):
        print(" ", end="")
    print(str(decr) * decr)
    decr -= 2

Output:

Output of the Python Descending Odd-Width Number Pyramid pattern
BEGINNER WALKTHROUGH

How the Descending Odd-Width Number Pyramid works

The centered rows repeat 7 seven times, 5 five times, 3 three times, and 1 once.

01

Build the rows

Each pass adds indentation for the smaller row and prints the current decr value.

02

Choose what each row prints

The same decr variable supplies both the digit and the repetition count, then decreases by two.

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.