If you want to print out a list of all dates between 2 dates (a date range), then you can use the following script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from datetime import date, timedelta

start_date = date(2021, 5, 31)
end_date = date(2021, 7, 28)

delta = end_date - start_date

for i in range(delta.days + 1):
    day = start_date + timedelta(days=i)
    print(day)

This will result in the following range:

1
2
3
4
5
2021-05-31
2021-06-01
...
2021-07-27
2021-07-28

To make sure that you get the format you want back:

1
day.strftime("%Y-%m-%d")