Answer the question
In order to leave comments, you need to log in
How to draw a triangle?
How to draw a triangle so that the inside of the triangle is empty.
so it turns out to do but it turns out complete
for i in range(n+1):
for j in range (n-i) :
print(end = " ")
for j in range (i + 1):
print("*", end = " ")
print()
Answer the question
In order to leave comments, you need to log in
height = 10
for row_level in range(height):
string = ''
for left_step in range(height - row_level):
string += ' '
string += '*'
for right_step in range(row_level * 2):
string += ' '
print(string + '*')
else:
string = ''
for i in range(height * 2 + 2):
string += '*'
print(string)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question