input: Write a function to determine the most common fruit name in a list containing fruit names. If there is a tie for the most common fruit, return the first one encountered with that frequency.
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Banana', 'Banana', 'Cherry', 'Cherry', 'Cherry'])=='Cherry'
  assert most_common_fruit(['Kiwi', 'Orange', 'Orange', 'Kiwi', 'Mango'])=='Kiwi'
  assert most_common_fruit(['Pear', 'Pear', 'Pear', 'Apple'])=='Pear'
  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