title: How to select elements in the intersection of two lists in Python
body: <p>As a quick example:</p>
  
  <pre><code>list1 = ['a', 'b', 'c']
  list2 = ['a', 'stack', 'overflow']
  for i in list1 and list2:
      print i
  </code></pre>
  
  <p>this prints all the elements in <code>list2</code>. Why is this? How can I just print the elements that are in both lists?</p>