Answer to Question #173903 in Python for sai

Question #173903

python code to print the right alphabetic triangle up to the given N rows.


1
Expert's answer
2021-03-21T06:37:24-0400
import string
alpha = list(string.ascii_lowercase)

n = int(input())
for i in range(1,n):
  for j in range(0,n-i):
    print(" ", end="")

  for k in reversed(range(0,i)):
    print(alpha[k], 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