Here is one way to draw the triangle:
blanks = 4
stars = 1

for i in range(5):
   print blanks * " " + stars * "*"
   blanks = blanks - 1
   stars = stars + 2
The way we have written it, all we care about is that there are five values that "i" takes on. So we could have written
blanks = 4
stars = 1

for i in ["Cubs","Sox","Bulls","Bears","Hawks"]:
   print blanks * " " + stars * "*"
   blanks = blanks - 1
   stars = stars + 2
There are other ways to do this. In fact, we could have used the object called "i" to calculate how many blanks and stars in each line. This way seems to be easier to read for many people. Here is the alternative, which many experienced coders would prefer:
for i in range(5):
   print 4 - i * " " + (2 * i + 1) * "*"
Shorter code is not always better. It depends on what you find easy to understand.

Now, we need a new concept, the function. We have already seen a function, the "range()" function, which is called a built-in function.

Try the following to get the idea

print range(5)
print range(3,9)
print range(3,9,2)
print range(9,3)
print range(9,3,-2)
print type(range)
So range is a name for an object of the 'function or method' type. It takes some values that we "pass" to it. The thigs we "pass" are sometimes called "parameters", which scientists may tell you is a misuse of the word, but never mind that.

We would like to be able to make our own function, the triangle function, so that we could type

triangle(3)
triangle(12)
and get
  *
 ***
*****
           *
          ***
         *****
        *******
       *********
      ***********
     *************
    ***************
   *****************
  *******************
 *********************
***********************
back from Python.

Read about defining a function