Write a Python program to print inverted triangle alphabets pattern using for loop.
rows = int(input("Enter Inverted Right Triangle Alphabets Pat Rows = ")) print("====Inverted Right Triangle Alphabets Pattern====") alphabet = 65 for i in range(0, rows): for j in range(rows - 1, i - 1, -1): print('%c' %(alphabet + j), end = ' ') print()
This Python example prints the inverted triangle pattern of alphabets using a while loop.
rows = int(input("Enter Inverted Right Triangle Alphabets Pat Rows = ")) print("====Inverted Right Triangle Alphabets Pattern====") alphabet = 65 i = 0 while(i < rows): j = rows - 1 while(j >= i): print('%c' %(alphabet + j), end = ' ') j = j - 1 print() i = i + 1
Enter Inverted Right Triangle Alphabets Pat Rows = 14
====Inverted Right Triangle Alphabets Pattern====
N M L K J I H G F E D C B A
N M L K J I H G F E D C B
N M L K J I H G F E D C
N M L K J I H G F E D
N M L K J I H G F E
N M L K J I H G F
N M L K J I H G
N M L K J I H
N M L K J I
N M L K J
N M L K
N M L
N M
N