input: Write a function to find the most common fruit name from a given list of fruits. If there are multiple fruits with the same highest frequency, return the one that appears first in the list.
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Banana', 'Banana', 'Orange', 'Orange', 'Banana'])=='Banana'
  assert most_common_fruit(['Pear', 'Grape', 'Pear', 'Grape', 'Orange'])=='Pear'
  assert most_common_fruit([])==None
  assert most_common_fruit(['Apple', 'Banana', 'Pineapple'])=='Apple'
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
      max_count = 0
      most_common = None
      for fruit in fruits:
          if fruit_count[fruit] > max_count:
              max_count = fruit_count[fruit]
              most_common = fruit
      return most_common