Print Bottom Half Hollow Diamond Pattern with alphabet symbols in reverse of dictionary order in Python

To print Bottom Half Hollow Diamond Pattern with alphabet symbols in reverse of dictionary order in Python

Code:

n = int(input('Enter n Value:'))
for i in range(n):
    print(' ' * i + chr(65 + i) + ' ', end='')
    if i != n - 1:
        print(' ' * (2 * n - 2 * i - 3) + chr(65 + i), end='')
    print()

Leave a comment