Python Centered Descending-Alphabet Pyramid (Pattern 42)

Python Code
inc = 1
for x in range(5, 0, -1):
    for y in range(x, 0, -1):
        print(" ", end="")
    for z in range(inc, 0, -1):
        print(chr(z + 64), end="")
    inc += 2;
    print()

Output:

Output of the Python Centered Descending-Alphabet Pyramid pattern
BEGINNER WALKTHROUGH

How the Centered Descending-Alphabet Pyramid works

Each centered row counts backward through letters, growing from A to CBA and then EDCBA.

01

Build the rows

The outer loop prints fewer leading spaces on every row to keep the widening shape centered.

02

Choose what each row prints

The inner counter starts at inc and moves down to 1; chr(z + 64) converts that countdown into letters.

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.