Solid Right Angled Triangle - 2
Given an integer number
The first line of input is an integer
In the given example, the solid right-angled triangle of side
5. Therefore, the output should be
*
* *
* * *
* * * *
N=int(input("Enter the right-angled triangle: "))
s=[]
for i in range(0,2*N): s.append(' ')
for i in range(0,(len(s)//2)-1):
s[(len(s)-2)-(2*i-1)] = '*'
t=""
for j in range(0, len(s)):
t = t+s[j]
print(t)
Comments
Leave a comment