title: Converting the number of days in a month in Python?
body: <p>New to Python, and I'm writing a program that has the user enter the month (in terms of a number, NOT the word - e.g. "3" not "March"), and the year (as in "2014"). I want the program to display the number of days in the month entered and the year. So if the user enters month 3 and the year 2005, it should display:</p>
  
  <p>March 2005 has 31 days.</p>
  
  <p>Here's my code: </p>
  
  <pre><code>def enteredMonth():
      month = int(input("Enter a month in terms of a number: "))
      return month
  
  def enteredYear():
      year = int(input("Enter a year: "))
      return int(year)
  
  def leapYear(year):
      if year % 4 == 0:
          return True
      else:
          return False
  
  def numberOfDays(month):
      if enteredMonth() == 1:
          month = "January"
          print ("31")
      elif enteredMonth() == 2:
          month = "February"
          print ("28")
      elif enteredMonth() == 2 and leapYear() == true:
          month = "February"
          print ("29")
      elif enteredMonth() == 3:
          month = "March"
          print ("31")
      elif enteredMonth() == 4:
          month = "April"
          print ("30")
      elif enteredMonth() == 5:
          month = "May"
          print ("31")
      elif enteredMonth() == 6:
          month = "June"
          print ("30")
      elif enteredMonth() == 7:
          month = "July"
          print ("31")
      elif enteredMonth() == 8:
          month = "August"
          print ("31")
      elif enteredMonth() == 9:
          month = "September"
          print ("30")
      elif enteredMonth() == 10:
          month = "October"
          print ("31")
      elif enteredMonth() == 11:
          month = "November"
          print ("30")
      elif enteredMonth() == 12:
          month = "December"
          print ("31")
      else:
          print("Please enter a valid month")
  
  def main():
     enteredMonth()
     enteredYear()
     leapYear(year)
     numberOfDays(month)
     print(month, enteredYear(), "has", numberOfDays(month) , "days")
  
  if __name__ == '__main__': 
     main()
  </code></pre>
  
  <p>The problem is that instead of getting the proper format, I'm getting something like: </p>
  
  <p>3 2005 has None days.</p>
  
  <p>Please help! I greatly appreciate it.</p>