code: def year(date):
      
      try:
          fmt = '%m/%d/%Y'
          return datetime.strptime(date, fmt).timetuple().tm_year
      except ValueError:
          return 0
docs: Returns the year.
  
      :param date:
          The string date with this format %m/%d/%Y
      :type date:
          String
  
      :returns:
          int
  
      :example:
          >>> year('05/1/2015')
          2015