Python Program to Print Right Triangle of Alphabets in Reverse

Write a Python program to print right triangle of alphabets in reverse pattern using for loop.

rows = int(input("Enter Right Triangle of Rev Alphabets Rows = "))

print("====The Right Triangle of Alphabets in Reverse Pattern====")
alphabet = 65

for i in range(rows - 1, -1, -1):
    for j in range(rows - 1, i - 1, -1):
        print('%c' %(alphabet + j), end = ' ')
    print()
Python Program to Print Right Triangle of Alphabets in Reverse

This Python pattern example uses a while loop to print the right-angled triangle of alphabets in reverse or descending order.

rows = int(input("Enter Right Triangle of Rev Alphabets Rows = "))

print("====The Right Triangle of Alphabets in Reverse Pattern====")
alphabet = 65
i = rows - 1

while(i >= 0):
    j = rows - 1
    while(j >= i):
        print('%c' %(alphabet + j), end = ' ')
        j = j - 1
    print()
    i = i - 1
Enter Right Triangle of Rev Alphabets Rows = 13
====The Right Triangle of Alphabets in Reverse Pattern====
M 
M L 
M L K 
M L K J 
M L K J I 
M L K J I H 
M L K J I H G 
M L K J I H G F 
M L K J I H G F E 
M L K J I H G F E D 
M L K J I H G F E D C 
M L K J I H G F E D C B 
M L K J I H G F E D C B A 

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.