Python Right-Aligned Alphabet-Prefix Triangle (Pattern 28)

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

Output:

Output of the Python Right-Aligned Alphabet-Prefix Triangle pattern
BEGINNER WALKTHROUGH

How the Right-Aligned Alphabet-Prefix Triangle works

The rows shift right while growing from A to AB, ABC, ABCD, and ABCDE.

01

Build the rows

The outer loop controls the row length, and the first inner loop prints the shrinking left padding.

02

Choose what each row prints

The second inner counter z starts at 1 on every line; chr(z + 64) converts it to A through the row limit.

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.