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