Bite 175. Find missing dates

Complete get_misssing_dates that takes an (unordered) sequence of datetime.date objects. It should determine what the start and end date of this sequence is and return the missing dates.

Here is an example (horizontal scroll code below):

>>> from datetime import date
>>> from missing_dates import get_misssing_dates
>>> date_range = [date(year=2019, month=2, day=n) for n in range(1, 11, 2)]
>>> date_range
[datetime.date(2019, 2, 1), datetime.date(2019, 2, 3), datetime.date(2019, 2, 5), datetime.date(2019, 2, 7), datetime.date(2019, 2, 9)]

# our function returns the missing dates
# = the ones that were not generated in the preceding code
>>> sorted(get_misssing_dates(date_range))
[datetime.date(2019, 2, 2), datetime.date(2019, 2, 4), datetime.date(2019, 2, 6), datetime.date(2019, 2, 8)]

Some modules make this fairly easy (hint hint).

Thanks @shravankumar147 for sharing this idea on Twitter last week :)

Good luck and keep calm and code in Python!

14 out of 15 users completed this Bite.
Will you be Pythonista #15 to crack this Bite?
Average Bite difficulty 1-10 rating: 2.0
» You can do it! 😌

Github login button
We use Python 3.7