avatar Bite 144. Calculate the Number of Months Passed

Some more fun working with dates! In this Bite you will calculate the number of months between the fixed START_DATE = date(2018, 11, 1) and the date you will construct from the input arguments.

You should raise the proper exceptions and perform the proper upper rounding based on the fact that >= 10 days in the datetime difference adds another month to the counter.

Best to give you some examples of the expected results so check out the docstring and tests, then start coding Python 💪. You probably want to use dateutil.relativedelta for this one! Good luck!

Login and get coding
go back Intermediate level
Bitecoin 3X

Will you be Pythonista #140 to crack this Bite?
Resolution time: ~41 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 3.86 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help