How to make triangle x in python from source code below
<p>Hello I want to ask everybody...
Like this...
I want to make a triangle X or *, like below:</p>

<pre><code>    *
   ***
  *****
 *******
*********
</code></pre>

<p>My Algorithm is like this:</p>

<pre><code>for y:=1 to i do
    for x:=1 to j do
       for j-x to 1 do write(' ');
       for i to 2*(x-1)+1 do write('*');
</code></pre>

<p>Can anybody tell me how is the source code for python like pascal in above?
Thanks for your answer</p>

<p>I have some code to do that lying around here, maybe this can help you :)</p>

<pre><code>def pascals_triangle(order):
    """
    :brief:         Compute the line of pascal's triangle with order 'order'
                    |       line          | order |
                    |---------------------|-------|
                    |         1           |   0   |
                    |       1   1         |   1   |
                    |     1   2   1       |   2   |
                    |    1   3   3   1    |   3   |
                    | 1   4   6   4   1   |   4   |
    :param order:   order of the line in pascal's triangle 
                    (starting with 0, which returns just [1])
    :return:        a list of the pascal's triangle line of order 'order'
    """
    line = [1]
    for k in xrange(order):
        line.append(line[k] * (order - k) / (k + 1))
    return line
</code></pre>

python algorithm pascal