input: Write a function to find the mode of the given set of values in Python. The mode is the value that appears most frequently in the list. If multiple values have the same highest frequency, return the first one encountered.
  
  assert find_mode([1, 2, 3, 2, 4, 2])==2
  assert find_mode([5, 5, 5, 1, 1, 1])==5
  assert find_mode([1, 2, 3, 4, 5])==1
  assert find_mode([10, 20, 30, 10, 20, 20])==20
  assert find_mode([1])==1
output: def find_mode(values):
      frequency = {}
      for value in values:
          if value in frequency:
              frequency[value] += 1
          else:
              frequency[value] = 1
      max_freq = max(frequency.values())
      for value in values:
          if frequency[value] == max_freq:
              return value