input: Write a Python function to count the number of customers for each year from a list of customer data dictionaries.
  assert count_customers_by_year([{'year': '2019'}, {'year': '2020'}, {'year': '2019'}, {'year': '2018'}, {'year': '2020'}, {'year': '2020'}]) == {'2019': 2, '2020': 3, '2018': 1}
  assert count_customers_by_year([{'year': '2021'}, {'year': '2021'}, {'year': '2022'}, {'year': '2021'}, {'year': '2022'}, {'year': '2023'}]) == {'2021': 3, '2022': 2, '2023': 1}
  assert count_customers_by_year([]) == {}
output: def count_customers_by_year(customers):
      result = {}
      for customer in customers:
          year = customer['year']
          if year in result:
              result[year] += 1
          else:
              result[year] = 1
      return result