Python Inward V Alphabet Pattern (Pattern 89)

Python Code
n = 5  # size=5
px = 1
py = n * 2 - 1
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 Inward V Alphabet Pattern pattern
BEGINNER WALKTHROUGH

How the Inward V Alphabet Pattern works

The diagonal arms move inward while their row labels progress from A through E.

01

Build the rows

The outer loop selects five rows and the inner loop checks each of the eleven column positions.

02

Choose what each row prints

The code prints chr(x + 64) when a column matches either moving marker; the markers converge after every line.

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.