title: Comparing elements between elements in two lists of tuples
body: <p>Here is what I am looking to do.I have two list of tuples. Build a list of elements such that the first element in a tuple in list1 matches the first element in a tuple in list 2</p>
  
  <pre><code>list1 = [('a', 2), ('b', 3), ('z', 5)]
  
  list2 = [('a', 1), ('b', 2), ('c', 3)]
  
  list3 = ['a','b']
  </code></pre>
  
  <p>Note: There can be no duplicate first elements</p>
  
  <p>After looking at python list comprehensions, this is what I have done </p>
  
  <pre><code>[x[0] for x in list1 if (x[0] in [y[0] for y in list2])]
  </code></pre>
  
  <p>My questions is would this be how an experienced python programmer would code this up? Having coded this up myself I still find this fairly hard to read. If not how else would you do it</p>