Alpha Pattern
Level EASY
Print the following pattern for the given N number of rows.
Pattern for N = 3
Input format :
Output format :
Constraints
Sample Input 1:
Sample Output 1:
Sample Input 2:
Sample Output 2:
A
BB
CCC
DDDD
EEEEE
FFFFFF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Read input as specified in the question. | |
## Print output as specified in the question. | |
l=['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'] | |
num=int(input()) | |
c=0 | |
for i in range(1,num+1): | |
for j in range(0,i): | |
print(l[i-1],end="") | |
print() | |
c=c+1 |
Comments
Post a Comment
Please give us your valuable feedback