title: Python generating a list of dates between two dates
body: <p>I want to generate a list of dates between two dates and store them in a list in string format. This list is useful to compare with other dates I have. </p>
  
  <p>My code is given below: </p>
  
  <pre><code>from datetime import date, timedelta
  
  sdate = date(2019,3,22)   # start date
  edate = date(2019,4,9)   # end date
  
  def dates_bwn_twodates(start_date, end_date):
      for n in range(int ((end_date - start_date).days)):
          yield start_date + timedelta(n)
  print(dates_bwn_twodates(sdate,edate))
  </code></pre>
  
  <p>My present output: </p>
  
  <pre><code>&lt;generator object dates_bwn_twodates at 0x000002A8E7929410&gt;
  </code></pre>
  
  <p>My expected output: </p>
  
  <pre><code>['2019-03-22',.....,'2019-04-08']
  </code></pre>
  
  <p>Something wrong in my code. </p>