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?
from datetime import date
b = date.today() - timedelta(days=1)
while b.weekday()>=5:
b = b - timedelta(days=1)