input: Write a function that takes a list containing fruit names and returns the most common fruit name. If the list is empty, return None.
  
  def most_common_fruit(fruit_list):
      if not fruit_list:
          return None
      
      # Dictionary to get count of each fruit
      freq_dict = {}
      
      # Count frequency of each fruit
      for fruit in fruit_list:
          if fruit in freq_dict:
              freq_dict[fruit] += 1
          else:
              freq_dict[fruit] = 1
      
      # Get maximum frequency 
      max_freq = max(freq_dict.values())
      
      # Get the most common fruit
      most_common_fruit = [fruit for fruit, freq in freq_dict.items() if freq == max_freq][0]
      
      return most_common_fruit
  
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple', 'Orange', 'Orange'])=='Orange'
  assert most_common_fruit([])==None
  assert most_common_fruit(['Apple'])=='Apple'
  assert most_common_fruit(['Apple', 'Apple', 'Apple', 'Orange', 'Orange'])=='Apple'
output: def most_common_fruit(fruit_list):
      if not fruit_list:
          return None
      
      freq_dict = {}
      
      for fruit in fruit_list:
          if fruit in freq_dict:
              freq_dict[fruit] += 1
          else:
              freq_dict[fruit] = 1
      
      max_freq = max(freq_dict.values())
      
      most_common_fruit = [fruit for fruit, freq in freq_dict.items() if freq == max_freq][0]
      
      return most_common_fruit