Answer to Question #167305 in Python for rongali dinesh kumar

Question #167305

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


1
Expert's answer
2021-02-26T19:53:58-0500
# Python 3 program to print the right alphabetic triangle up to the given N rows
# Prompt user to input number of rows
N = int(input("Enter the number of rows to print N: "))

for i in range(1, N + 1):
    for j in range(i, N + 1):
        print(chr(ord('A') - 1 + j), 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