def index_in_list(lst, val):
  """Returns the index of an element in a list

  Runs a linear search

  Args:
    lst: list where to search the element
    val: element to search for
  """

  i = 0
  for item in lst:
    if item == val:
      return i
    i += 1
  return -1