title: Python design pattern for many conditions
body: <p>What is the recommended structure to write validate functions with many conditions? See these two examples. The first looks ugly, the second isn't very common, perhaps because <code>assert</code> is generally used to rule out unexpected behaviour. Are there better alternatives?</p>
  
  <pre><code>def validate(val):
    if cond1(val):
      return False
    if cond2(val):
      return False
    if cond3(val)
      return False
    return True
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>def validate(val):
    try:
      assert cond1(val)
      assert cond2(val)
      assert cond3(val)
      return True
    except AssertionError:
      return False
  </code></pre>