title: Python get days in a month output 0
body: <p>When ever I ran this the output is always 0 where i was expecting like 29 or 30.</p>
  
  <pre><code>import datetime
  
  def days_in_month(year, month):
      """
      Inputs:
        year  - an integer between datetime.MINYEAR and datetime.MAXYEAR
                representing the year
        month - an integer between 1 and 12 representing the month
  
      Returns:
        The number of days in the input month.
      """
  
      #if month is december, we proceed to next year
      def month_december(month):
          if month == 12:
              return 1
          else:
              return month
  
      #if month is december, we proceed to next year
      def year_december(year, month):
          if month == 12:
              return new_year + 1
          else:
              return year
  
      #verify if month/year is valid
      if (month &lt; 1) or (month &gt; 12):
          print ("please enter a valid month")
      elif (year &lt; 1) or (year &gt; 9999):
          print ("please enter a valid year between 1 - 9999")
      else:
          #subtract current month from next month then get days
          date1 = (datetime.date(year_december(year, month), month_december(month), 1) - datetime.date(year, month, 1)).days
          print (date1)
  
  days_in_month(1997, 1)
  </code></pre>