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 pattern example prints the triangle of alphabets in descending order or reverse order using a while loop.

rows = int(input("Enter 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 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