GRAND ASSIGNMENT - 2 Alphabetic Symbol

 Alphabetic Symbol

Write a program to print the right alphabetic triangle up to the given N rows.
Input

The input will be a single line containing a positive integer (N).
Output

The output should be N rows with letters.
Note: There is a space after each letter.
Explanation

For example, if the given number of rows is 4,
your code should print the following pattern.
A 
A B 
A B C 
A B C D
Sample Input 1
4
Sample Output 1
A 
A B 
A B C 
A B C D 
Sample Input 2
6
Sample Output 2
A 
A B 
A B C 
A B C D 
A B C D E 
A B C D E F 



code;



r=int(input())
alphabet=65

for i in range (0,r):
    for j in range (0,i+1):
        print("%c"%(alphabet+j),end =" ")
    print()

Comments

Popular posts from this blog

CODING ASSIGNMENT 3 Library Management

CODING PRACTICE 11 Music Page

CCBP Static Website Coding Assignment 2 Solution | Yoga Page