title: Including first and last elements in list comprehension
body: <p>I would like to keep the first and last elements of a list, and exclude others that meet defined criteria without using a loop. The first and last elements may or may not have the criteria of elements being removed. </p>
  
  <p>As a very basic example,  </p>
  
  <pre><code>aList = ['a','b','a','b','a']
  
  [x for x in aList if x !='a']
  </code></pre>
  
  <p>returns <code>['b', 'b']</code></p>
  
  <p>I need <code>['a','b','b','a']</code></p>
  
  <p>I can split off the first and last values and then re-concatenate them together, but this doesn't seem very Pythonic. </p>