Python program to print Pattern example 94

= 9  # size
px = n // 2 + 1
= 0  # print val
for x in range(1, n + 1):
    for y in range(1, n + 1):
        if (== px or y == n - px + 1):
            print(chr(+ 65), end="")
        else:
            print(" ", end="")
    if (<= n / 2):
        px -= 1
        p += 1
    else:
        px += 1
        p -= 1
    print()

Output:
Patterns Programs

Subscribe For Daily Updates

100+ Python Pattern Examplespython pattern examples - star patterns, number patterns