Python Program to Print Square of Right Increment Alphabets Pattern

Write a Python program to print square of right increment alphabets pattern using for loop.

rows = int(input("Enter Square of Right Increment Alphabets Rows = "))

print("====The Square of Right Incremented Alphabets Pattern====")
alphabet = 65

for i in range(rows):
    for j in range(rows - 1, i, -1):
        print('A', end = ' ')
    for k in range(i + 1):
        print('%c' %(alphabet + i), end = ' ')
    print()
Python Program to Print Square of Right Increment Alphabets Pattern

This Python program prints the square pattern of increment alphabets from the right hand side using a while loop.

rows = int(input("Enter Square of Right Increment Alphabets Rows = "))

print("====The Square of Right Incremented Alphabets Pattern====")
alphabet = 65
i = 0

while(i < rows):
    j = rows - 1
    while(j > i):
        print('A', end = ' ')
        j = j - 1
    k = 0
    while(k <= i):
        print('%c' %(alphabet + i), end = ' ')
        k = k + 1
    print()
    i = i + 1
Enter Square of Right Increment Alphabets Rows = 12
====The Square of Right Incremented Alphabets Pattern====
A A A A A A A A A A A A 
A A A A A A A A A A B B 
A A A A A A A A A C C C 
A A A A A A A A D D D D 
A A A A A A A E E E E E 
A A A A A A F F F F F F 
A A A A A G G G G G G G 
A A A A H H H H H H H H 
A A A I I I I I I I I I 
A A J J J J J J J J J J 
A K K K K K K K K K K K 
L L L L L L L L L L L L 

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.