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()
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