title: Appending to list of lists in for loop
body: <p>I am currently iterating through one value of a list. On each iteration, I append the list to a new list, in order to have a list of lists. However, the outputs that I am receiving aren't what I am expecting them to be.</p>
  
  <p>I've simplified the problem as much as possible and have arrived at this :</p>
  
  <pre><code>def Function():
       ListOfLists = []
       Lists = [0]
       for j in range(0, 5):
           Lists[0] = Lists[0] + 1
           print(Lists)
           ListOfLists.append(Lists)
       print("ListofLists:")
       print(ListOfLists)
  
  Function()
  </code></pre>
  
  <p>The output gives me this : </p>
  
  <pre><code>[1]
  [2]
  [3]
  [4]
  [5]
  ListofLists:
  [[5], [5], [5], [5], [5]]
  </code></pre>
  
  <p>I would've expected the output to be :</p>
  
  <pre><code>[1]
  [2]
  [3]
  [4]
  [5]
  ListofLists:
  [[1], [2], [3], [4], [5]]
  </code></pre>
  
  <p>Where am I going wrong? 
  Thanks</p>