title: can't find the mistake Itering through list of dates
body: <p>I'm writing a program to find how many sundays on the first of a month there are between two dates.<br />
  I want to do it without using datatime.<br />
  The thing is, I obtain 173 when the expected answer is 171.</p>
  <pre class="lang-py prettyprint-override"><code>#How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
  days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
  
  dict_months = {&quot;January&quot;: 31, &quot;February&quot;: 28, &quot;March&quot;: 31, &quot;April&quot;: 30, &quot;May&quot;: 31, &quot;June&quot;: 30, &quot;July&quot;: 31, &quot;August&quot;: 31, &quot;September&quot;: 30, &quot;October&quot;: 31, &quot;November&quot;: 30, &quot;December&quot;: 31}
  
  count = 0
  weekday_index = -1
  
  for year in range(1900,2001):    
      for month in dict_months:
          #handling february
          if month == &quot;February&quot;:
              #handling gap year
              if year % 4 == 0:
                  #if year is a century it is not a leap year unless it is also a multiple of 400
                  if year % 100 == 0 and year % 400 != 0:
                      dict_months[month] = 28
                  else:
                      dict_months[&quot;February&quot;] = 29
              else:
                  dict_months[&quot;February&quot;] = 28
          for day in range(1, dict_months[month]+1):
              weekday_index += 1
              weekday = days_of_week[weekday_index]
              #handling sundays
              if weekday == 'Sunday':
                  weekday_index = -1
                  if day == 1:
                      # print(f&quot;{month} {day} {year}&quot;)
                      count += 1
  
  print(count)    
  </code></pre>