Python Program to Print Triangle of Alphabets in Reverse Pattern

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

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

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

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

This Python pattern example prints the triangle of alphabets in descending order or reverse order using a while loop.

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

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

while(i >= 0):
    j = 0
    while(j < i):
        print(end = ' ')
        j = j + 1
    k = i
    while(k < rows):
        print('%c' %(alphabet + k), end = ' ')
        k = k + 1
    print()
    i = i - 1
Enter Triangle of Reverse Alphabets Rows = 12
====The Triangle of Alphabets in Reverse Pattern====
           L 
          K L 
         J K L 
        I J K L 
       H I J K L 
      G H I J K L 
     F G H I J K L 
    E F G H I J K L 
   D E F G H I J K L 
  C D E F G H I J K L 
 B C D E F G H I J K L 
A B C D E F G H I J K 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.