Answer to Question #299039 in Python for Sai

Question #299039

Write a program to print the right alphabet tringle up to the given N rows.



Input



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



Output



The output should bbe 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



Input:



4



Output:



A



A B



A B C



A B C D

1
Expert's answer
2022-02-17T08:15:27-0500
N = int(input())
for r in range(0, N+1):
    for l in range(65, 65+r):
        print(chr(l), end=" ")
    print(" ")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS