input: Write a function to return the most common fruit name from a list of fruit names. If there is a tie, return the first one that appears with that frequency. If the list is empty, return None.
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Orange', 'Apple', 'Grape', 'Apple', 'Grape'])=='Apple'
  assert most_common_fruit(['Apple', 'Apple', 'Orange', 'Orange', 'Grape', 'Grape'])=='Apple'
  assert most_common_fruit(['Orange', 'Orange', 'Grape', 'Grape', 'Pineapple', 'Pineapple'])=='Orange'
  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
      max_count = max(fruit_count.values())
      for fruit in fruits:
          if fruit_count[fruit] == max_count:
              return fruit