title: Appending Items by Iterating list
body: <p>I've designed a following function that takes a list as a parameter and returns another list.</p>
  
  <pre><code>def function(list):
      A = []
      B = []
      for num in list:
          A.append(num)
          B.append(A)
      return B
  </code></pre>
  
  <p>In this function, I assumed that the function would append A to A depending on the current state of A. Working under that assumption. I called the function</p>
  
  <pre><code>&gt;&gt;&gt; test([1,2,3,4,5])
  </code></pre>
  
  <p>expected the output to be </p>
  
  <pre><code>[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5]]
  </code></pre>
  
  <p>However, the result that I get is </p>
  
  <pre><code>[[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]
  </code></pre>
  
  <p>Why is this? Is there any solution around this problem?</p>