Python Inverted Descending-Alphabet Triangle (Pattern 73)

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

Output:

Output of the Python Inverted Descending-Alphabet Triangle pattern
BEGINNER WALKTHROUGH

How the Inverted Descending-Alphabet Triangle works

The rows count down from E to A, then D to A, C to A, and so on as they shift right.

01

Build the rows

The outer loop counts down through five rows, and the leading spaces increase as each row shortens.

02

Choose what each row prints

The inner z counter starts at x and counts down to 1; chr(z + 64) converts each value to a letter.

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.