input: Write a function to find the mode of a given list of values. If there is no mode (every element is unique), return any element. The function should return the mode element.
  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, 2, 3, 4, 5]) == 1
  assert find_mode([10, 10, 20, 20, 30]) == 10
  assert find_mode([6, 6, 6, 6, 6]) == 6
  assert find_mode([7, 8, 9, 10, 11]) == 7
output: 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