Python Repeated-Letter Triangle (Pattern 13)

Python Code
for x in range(65, 70):
    for y in range(65, x + 1):
        print(chr(x), end="")
    print()

Output:

Output of the Python Repeated-Letter Triangle pattern
BEGINNER WALKTHROUGH

How the Repeated-Letter Triangle works

The rows repeat A once, B twice, C three times, D four times, and E five times.

01

Build the rows

The outer loop advances through the character codes for A to E, selecting one letter for each row.

02

Choose what each row prints

The inner range grows with the row code, and chr(x) prints the selected letter for each iteration.

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.