Write a program to print the right alphabetic triangle up to the given N rows.
# 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()
Comments
Leave a comment