Python Inverted Alphabet-Prefix Triangle (Pattern 74)

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

Output:

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

How the Inverted Alphabet-Prefix Triangle works

The rows show ABCDE, ABCD, ABC, AB, and A, moving right as they get shorter.

01

Build the rows

The outer loop decreases x and a separate loop adds the indentation for each row.

02

Choose what each row prints

The inner counter starts at zero and runs to x - 1; chr(z + 65) prints the matching alphabet prefix.

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.