Here is my current code. The question is exactly in the title. (I'm looking to be able to align my triangle correctly)
if height % 2 == 0:
print "Please enter a height that is odd"
stringTriangle = "x"
for x in range(height):
for x in range(1):
To make a string containing
n spaces, use
" "*n. To concatenate two strings
a + b. To learn about other things that can be done with strings, see Python 2: Built-in Types:
str and Other Sequence Types.
From there, you should be able to solve your homework problem by calculating how many spaces and how many asterisks you need in each line of the figure.