Write a Python program to print mirrored right triangle alphabets pattern using for loop.
rows = int(input("Enter Mirrored Right Triangle Alphabets Pat Rows = ")) print("====The Mirrored Right Triangle Alphabets Pattern====") alphabet = 65 for i in range(0, rows + 1): for j in range(1, rows - i + 1): print(end = ' ') for k in range(i + 1): print('%c' %(alphabet + i), end = '') print()
This Python example prints the mirrored right angled triangle of alphabets pattern using a while loop.
rows = int(input("Enter Mirrored Right Triangle Alphabets Pat Rows = ")) print("====The Mirrored Right Triangle Alphabets Pattern====") alphabet = 65 i = 0 while(i <= rows): j = 1 while(j <= rows - i): print(end = ' ') j = j + 1 k = 0 while(k <= i): print('%c' %(alphabet + i), end = '') k = k + 1 print() i = i + 1
Enter Mirrored Right Triangle Alphabets Pat Rows = 13
====The Mirrored Right Triangle Alphabets Pattern====
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
HHHHHHHH
IIIIIIIII
JJJJJJJJJJ
KKKKKKKKKKK
LLLLLLLLLLLL
MMMMMMMMMMMMM
NNNNNNNNNNNNNN