title: Python logical or operator acting strange
body: <p>I am trying to populate a list called <code>images</code> with files that have the extensions <code>'.png'</code>, <code>'.jpg'</code> or <code>'jpeg'</code> in a one line for loop. I tried this by using the logical <code>or</code> operator but that only resulted in an empty list. </p>
  
  <p><code>images = [i for i in os.listdir('.') if i[-4:] == ('.png' or '.jpg' or 'jpeg')]</code></p>
  
  <p>How do I check to see if <code>'.png'</code>, <code>'.jpg'</code> or <code>'jpeg'</code> are the last 4 characters of the file while keeping it all in a one line for loop?</p>