title: Project Euler #19, Python
body: <p>I was solving <a href="https://projecteuler.net/problem=19" rel="nofollow noreferrer">Project Euler #19</a>:</p>
  
  <p>How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?</p>
  
  <p>And here is the code :</p>
  
  <pre><code>months = { "January": 31,
          "February" : 28,
          "March" : 31,
          "April" : 30,
          "May" : 31,
          "June" : 30,
          "July" : 31,
          "August" : 31,
          "September" : 30,
          "October" : 31,
          "November" : 30,
          "December" : 31}
  
  def countingSundays():
      day = 1
      sunday_count = 0
  
      for year in xrange(1901,2001):
  
          for m in months:
  
              day += months[m]
              if year % 4 == 0 and m == "February":
                  day += 1
              if day % 7 == 0:
                  sunday_count += 1
  
  print "Sundays:", sunday_count
  </code></pre>
  
  <p>The output of the program is 172 which is incorrect.
  I searched the answer to be 171. 
  So I wanted to know why am I getting the extra 1 Sunday ?</p>