title: Python: handle python list
body: <p>I have a python list <code>x = [['a',1], ['b',3],['d',5]]</code> and I want to store the values of the second column in a new list <code>y = [['a',1], ['b',3], ['c',0], ['d',5]]</code>
  Not necessarily the first list would have all a,b,c,d entries.
  Here is what I have right now:</p>
  
  <pre><code>    x = [['a',1], ['b',3],['d',5]]
      y = []
      b = ('a','b','c','d')
      for key in b:
          for i, sublist in enumerate(x):
              if sublist[0] == key:
                  y.append(sublist)
              else
                  y.append([key,0])
      print y
  </code></pre>
  
  <p>This gives:</p>
  
  <pre><code>[['a', 1], ['a', 0], ['a', 0], ['b', 0], ['b', 3], ['b', 0], ['c', 0], ['c', 0], ['c', 0], ['d', 0], ['d', 0], ['d', 5]]
  </code></pre>
  
  <p>What is it that I am doing wrong?</p>