title: How to fill the none values to a list of tuples using Python
body: <p>I want to write a code that can merge list a&amp;b to get list c by filling list a with tuples, of which tuple[0] is none and tuple[1] is the values that are in b but not in a[index][1]. For instance,</p>
  
  <pre class="lang-py prettyprint-override"><code>a=[(1,None),(2,4),(3,6),(4,None),(5,9)];
  b=[4,5,6,7,9]
  </code></pre>
  
  <p>The desired c should be </p>
  
  <pre class="lang-py prettyprint-override"><code>c=[(1,None),(2,4),(None,5),(3,6),(4,None),(None,7),(5,9)]
  </code></pre>
  
  <p>I wrote a simple code as below that appended (None,5) at the end of the list. My actual intention is to insert it as the order of list b (I'm not sure how). Also, it seems to be inefficient as the number of elements in each list grows. </p>
  
  <pre><code>import itertools
  a=[(1,None),(2,4),(3,6),(4,None),(5,9)]
  b=[4,5,6,7,9]
  for elem2 in b:
      for elem1 in a:
          if elem1[1]==elem2:
              #print(str(elem2) +'is in.')
              break
      else:
          a.append((None,elem2))
  print(a)
  </code></pre>
  
  <p>Is there a special function that can achieve the merge? </p>