title: Making Pascal's triangle
body: <pre><code>def tri(fib_lst,n):
  
      lst = []
      if n &gt; 1:
          for i in range(n):
              if i == 0 or i == n-1:
                  lst.append(1)
              else:
                  lst.append((i-1)+i)
      if n &lt;= 1:
          lst.append(1)
      return lst
  
  def draw_pascal_triangle(fib_lst,n):
  
      for i in range(n):
          fib_lst.append(tri(fib_lst, i+1))
  </code></pre>
  
  <p>Then to get results I entered the following:</p>
  
  <pre><code>&gt;&gt;&gt; lst = []
  &gt;&gt;&gt; lst2 = []
  &gt;&gt;&gt; draw_pascal_triangle(lst, 5)
  &gt;&gt;&gt; draw_pascal_triangle(lst, 8)
  &gt;&gt;&gt; print(lst)
  &gt;&gt;&gt; print(lst2)
  </code></pre>
  
  <p>The results were:</p>
  
  <pre><code>[[1], [1, 1], [1, 1, 1], [1, 1, 3, 1], [1, 1, 3, 5, 1], [1], [1, 1], [1, 1, 1], [1, 1, 3, 1], [1, 1, 3, 5, 1], [1, 1, 3, 5, 7, 1], [1, 1, 3, 5, 7, 9, 1], [1, 1, 3, 5, 7, 9, 11, 1]]
  </code></pre>
  
  <p>I know that my problem is occurring in the line:</p>
  
  <pre><code>else:
      lst.append((i+1)+i)
  </code></pre>
  
  <p>but I don't know what to do to fix my mistake.</p>