title: Python elegant way of finding the last weekday
body: <p>I need to find the last weekday (without considering holidays). Is there any more elegant/robust way of implementing this than the one I'm currently using?</p>
  <pre><code>from datetime import date
  b = date.today() - timedelta(days=1)
  while b.weekday()&gt;=5:
      b = b - timedelta(days=1)
  </code></pre>