C
cbrown
It's clear but tedious to write:
if 'monday" in days_off or "tuesday" in days_off:
doSomething
I currently am tending to write:
if any([d for d in ['monday', 'tuesday'] if d in days_off]):
doSomething
Is there a better pythonic idiom for this situation?
Cheers - Chas
if 'monday" in days_off or "tuesday" in days_off:
doSomething
I currently am tending to write:
if any([d for d in ['monday', 'tuesday'] if d in days_off]):
doSomething
Is there a better pythonic idiom for this situation?
Cheers - Chas