Even though i write this code i am not able to get proper output.please help me to do. This
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
*
* *
* * *
* * * *
Comments
Leave a comment