input: Write a function to determine the most common fruit name from a list of fruit names. If there are multiple fruits with the same highest frequency, return the first one encountered in the list. If the list is empty, return None. The function should take a list of fruit names as its input.
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple']) == 'Apple'
  assert most_common_fruit(['Banana', 'Banana', 'Apple', 'Apple', 'Apple', 'Banana']) == 'Banana'
  assert most_common_fruit(['Apple']) == 'Apple'
  assert most_common_fruit([]) == None
output: def most_common_fruit(fruits):
      if not fruits:
          return None
      fruit_count = {}
      for fruit in fruits:
          if fruit in fruit_count:
              fruit_count[fruit] += 1
          else:
              fruit_count[fruit] = 1
      most_common = max(fruit_count, key=fruit_count.get)
      return most_common