title: Python: Boolean return if arbitrary element is in arbitrary list
body: <p>Noob wondering how to improve his code.</p>
  
  <pre><code>a, b, c = string.split(enteredDate, "/")
  
  m31s = [1, 3, 5, 7, 8, 10, 12]
  m30s = [4, 6, 9, 11]
  
  for x in range(len(m31s)):
      x = int(m31s[x])
      if x != int(a) and b != 31:
           print "Invalid date."
  for x in range(len(m30s)):
      et cetera...
  </code></pre>
  
  <p>In case it isn't clear, I am testing an inputted date to see if it is valid. This is only part of the program. <strong>The main question is</strong>: what is the best way to test if an element matches ANY element in a list?</p>
  
  <p>My method works... But, I suspect there is a better way to do this. I said boolean in the title because I envision something like:</p>
  
  <pre><code>if secretCode(m31s, int(a)) == True:
  </code></pre>
  
  <p>Could be a pipedream. Just curious.</p>
  
  <p>Thanks to anyone who takes the time to help.</p>