Python Top-Down V Alphabet Pattern (Pattern 84)

Python Code
n = 5  # size=5
px = n
py = n
for x in range(1, n + 1):
    for y in range(1, n * 2 + 1):
        if (y == px or y == py):
            print(chr(x + 64), end="")  # 1
        else:
            print(" ", end="")
    px -= 1
    py += 1
    print()

    """
    1+64>> 65 >> ASCII of 'A'
    """

Output:

Output of the Python Top-Down V Alphabet Pattern pattern
BEGINNER WALKTHROUGH

How the Top-Down V Alphabet Pattern works

The V-shaped diagonals widen downward and are labeled A, B, C, D, and E by row.

01

Build the rows

The outer loop selects the row letter and the inner loop checks eleven column positions.

02

Choose what each row prints

At either diagonal marker, chr(x + 64) converts the row number to its letter; the markers move outward on each pass.

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.