Else clause with for and while loop
<p>You can use the <code>else</code> clause with <code>for</code> and <code>while</code> loops (<a href="http://docs.python.org/2/reference/compound_stmts.html#for" rel="nofollow">docs</a>).</p>

<pre><code>def has_odd(l):      
  for num in l:
    if num % 2 != 0:
      print "odd's in the list"
      break
  else:
    print "no odd's in the list"
</code></pre>

<p>This construct helps to concolidate the code as opposed to the following equivalent:</p>

<pre><code>def has_odd(l):
  is_odd = False
  for num in l:
    if num % 2 != 0:
      is_odd = True
      break
  if is_odd:
    print "odd's in the list"
  else:
    print "no odd's in the list"
</code></pre>

<p>Yet, you don't see it used very often. What are the other use cases for the construct? </p>
