Python Repeated-Letter Pyramid (Pattern 37)

Python Code
inc = 1
char = 65  # ASCII of 'A'
for x in range(5, 0, -1):
    for y in range(x, 0, -1):
        print(" ", end="")
    print(chr(char) * inc, end="")
    char += 1
    inc += 2;
    print()

Output:

Output of the Python Repeated-Letter Pyramid pattern
BEGINNER WALKTHROUGH

How the Repeated-Letter Pyramid works

A centered alphabet pyramid repeats A once, B three times, C five times, then continues through E.

01

Build the rows

The outer loop reduces the leading spaces as the pyramid grows from top to bottom.

02

Choose what each row prints

The odd-width counter inc controls repetitions, and char advances by one so each new row uses the next 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.