Answer to Question #244727 in Python for Lovely

Question #244727

Even though i write this code i am not able to get proper output.please help me to do. This


1
Expert's answer
2021-09-30T02:25:38-0400
n = int(input())
for i in range(1, n+1):
  print(' '*n, end='') # repet space for n times
  print('* '*(i)) # repeat stars for i times
  n-=1


No code is provided but i added one code from my side to understand python. You have to run this code and give number of lines as input and this code will print equilateral triangle. See sample Input output below.

4

  * 

  * * 

 * * * 

 * * * * 


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