"Chris" <secun at yahoo.com> wrote: > Is there a way to make python create a list of Mondays for a given year? > > For example, > > mondays = ['1/3/2005','1/10/2005','1/17/2005','1/24/2005', > '1/31/2005','2/7/2005', ... ] Get the dateutil package (https://moin.conectiva.com.br/DateUtil): import dateutil.rrule as rrule from datetime import date mondays2005 = tuple(rrule.rrule(rrule.WEEKLY, dtstart=date(2005,1,1), count=52, byweekday=rrule.MO)) George
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4