Python Descending Alphabet-Value Pyramid (Pattern 52)

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

Output:

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

How the Descending Alphabet-Value Pyramid works

The centered rows repeat G seven times, E five times, C three times, and A once.

01

Build the rows

The outer loop adds one row at a time and increases the left indentation as the width shrinks.

02

Choose what each row prints

The code converts decr plus 64 to a letter, so the letter follows the odd row width as it counts down.

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.