0
I want to string a question in triangle of stars
Print ("* ** *** **** ")
3 Respuestas
+ 2
for x in range(15):
print(' '*(15-x)+'*'*x+'*'*x+'*')
https://code.sololearn.com/cuiP99YX3cKW/?ref=app
+ 2
Hi Rishanthan!
Here, you can just print each separated stars in newline. That's also a kind of triangle shape.
For that, you can use "\n" character between the strings. We believe this is clearly taught in strings lesson of python for beginners course.
0
for x in range(i := int(input())): print (' '*(i-x)+'**'*x+'*')