input: Write a function to find the mode of the given set of values. The mode is the element that appears most frequently in the list. If there are multiple elements with the same highest frequency, return any one of them.
  def find_mode(list):
    max_count = 0
    mode = list[0]
    count = {}
    for item in list:
      if (item in count):
        count[item] += 1
      else:
        count[item] = 1
      if (count[item] > max_count):
        max_count = count[item]
        mode = item
    return mode
  
  assert find_mode([1, 2, 3, 2, 4, 2])==2
  assert find_mode([1, 3, 3, 2, 4, 2]) in [2, 3]
  assert find_mode([1, 2, 3, 4, 5]) in [1, 2, 3, 4, 5]
  assert find_mode([])==None
output: def find_mode(list):
    if not list:
      return None
    max_count = 0
    mode = list[0]
    count = {}
    for item in list:
      if item in count:
        count[item] += 1
      else:
        count[item] = 1
      if count[item] > max_count:
        max_count = count[item]
        mode = item
    return mode