Write a Python program to print right triangle of consecutive row alphabets pattern using for loop.
rows = int(input("Enter Right Triangle Consecutive Row Alphabets Rows = ")) print("====The Right Triangle of Consecutive Row Alphabets Pattern====") alphabet = 64 for i in range(1, rows + 1): val = i for j in range(1, i + 1): print('%c' %(alphabet + val), end = ' ') val = val + rows - j print()
This Python pattern example displays the right angled triangle of consecutive alphabets using a while loop.
rows = int(input("Enter Right Triangle Consecutive Row Alphabets Rows = ")) print("====The Right Triangle of Consecutive Row Alphabets Pattern====") alphabet = 64 i = 1 while(i <= rows): val = i j = 1 while(j <= i): print('%c' %(alphabet + val), end = ' ') val = val + rows - j j = j + 1 print() i = i + 1
Enter Right Triangle Consecutive Row Alphabets Rows = 10
====The Right Triangle of Consecutive Row Alphabets Pattern====
A
B K
C L T
D M U \
E N V ] c
F O W ^ d i
G P X _ e j n
H Q Y ` f k o r
I R Z a g l p s u
J S [ b h m q t v w