How to find number of whole weeks between dates?

Mark Lawrence breamoreboy at yahoo.co.uk
Wed Jun 10 16:26:01 EDT 2015


On 10/06/2015 21:11, Sebastian M Cheung via Python-list wrote:
> On Wednesday, June 10, 2015 at 6:06:09 PM UTC+1, Sebastian M Cheung wrote:
>> Say in 2014 April to May whole weeks would be 7th, 14th 28th April and  May would be 5th, 12th and 19th. So expecting 7 whole weeks in total
>
> What I mean is given two dates I want to find WHOLE weeks, so if given the 2014 calendar and function has two inputs (4th and 5th month) then 7th, 14th, 21st and 28th from April with 28th April week carrying into May, and then 5th, 12th and 19th May to give total of 7 whole weeks, because 26th May is not a whole week and will not be counted.
>
> Hope thats clear.
>

If you'd be kind enough to show the code that you've written and the 
precise reasons(s) that it doesn't work then we'll be delighted to point 
you in the right direction.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list