I need to make a tree from *, the height need to be the number the user insert with 2 more * for extra row, and the brunk 1/3 of it.
In addition, the last row need to be with no space before.
I made the whole code, but the last and longest row appear with one space before..
where am I worong?
print "Enter tree height:"
height=input()
i=1
space=height-1
while i<=2*height:
print space*" ",i*"*"
i=i+2
space=space-1
trunk=height/3
j=0
while j<trunk:
print (height-1)*" ","*"
j=j+1
output:
Enter tree height: 3
*
***
*****
*
Enter tree height: 8
*
***
*****
*******
*********
***********
*************
***************
*
*
try change:
by:
when you do:
the output is different than