Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

13
  • 2
    Can you just elaborate your code by explaining it, specially on the monday1 and monday2 calculations. Commented Jan 7, 2013 at 7:56
  • 2
    Works perfectly, spans across years and weeks. Very concise too. Thanks a lot :) Commented Jan 7, 2013 at 8:05
  • I get an error with days() : (Pdb) (monday2 - monday1).days() *** TypeError: 'int' object is not callable (Pdb) (monday2 - monday1).days 77 Commented May 3, 2013 at 19:30
  • Guess I'm a bit late here.. Shouldn't the last line be: print (monday2 - monday1).days/7 instead of print (monday2 - monday1).days()/7 Commented Apr 4, 2014 at 18:43
  • 1
    I just edited the answer so that "days" is used instead of "days()". So the last few comments will no longer be relevant (assuming the edit is accepted). I added 'Weeks:' only because edits have to change at least 6 characters. Commented Jul 22, 2015 at 15:10