input: Write a function to find the mode of a 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. The function should take a list as input and return the mode.
  
  def find_mode(values):
    max_count = 0
    mode = values[0]
    count = {}
    for item in values:
      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, 1, 2, 2, 3, 3])==1
  assert find_mode([5, 5, 5, 2, 2, 2, 2])==2
  assert find_mode([1])==1
  assert find_mode([1, 2, 3, 4, 4, 4, 5, 5, 5, 6, 10])==4
output: def find_mode(values):
    max_count = 0
    mode = values[0]
    count = {}
    for item in values:
      if item in count:
        count[item] += 1
      else:
        count[item] = 1
      if count[item] > max_count:
        max_count = count[item]
        mode = item
    return mode