0

How would I go about calculating how many weeks are in a month, afterwards for each of those days in each week of those months I would like to perform some arithmetic. I am open to any suggestions on how to complete this task.

  • How do you define if a week is in a month? Weeks can overlap between two months. – Olivier Melançon Jun 14 '18 at 18:06
  • [`Calendar.itermonthdates`](https://docs.python.org/3/library/calendar.html#calendar.Calendar.itermonthdates) will give you an iterator over the a month. Each item will be a tuple with a `Date` object representing the day, and a day number representing which day of the week it is. It returns such tuples for all such dates that are in weeks that are at least partially in the given month. – Patrick Haugh Jun 14 '18 at 18:14

0 Answers0