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