title: Python: Appending items to lists by iterating through list of lists
body: <p>I'm a Python newbie crossing over from C. I'm basically trying implement logic equivalent to an array of array pointers in C. </p>
  
  <p>I want to append one item to the ends of a bunch of lists by iterating over a list of these lists. I have the following code:</p>
  
  <pre><code>data = [10, 20, 30]
  list1 = list2 = list3 = list()
  lists = [list1, list2, list3]
  
  for i in range(len(data)):
      lists[i].append(data[i])
  
  for lst in lists:
      print lst
  </code></pre>
  
  <p>It's result, however, is:</p>
  
  <pre><code>[10, 20, 30]
  [10, 20, 30]
  [10, 20, 30]
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>[10]
  [20]
  [30]
  </code></pre>
  
  <p>I can't explain why this code fails to produce the desired output, and is there some other way of doing this?</p>