input: Write a python function to replace an element in a list at a specified position.
  assert replace_elem([1, 2, 3, 4, 5], 8, 3) == [1, 2, 3, 8, 5]
  assert replace_elem([10, 20, 30, 40, 50], 99, 1) == [10, 99, 30, 40, 50]
  assert replace_elem([7, 14, 21, 28, 35], 42, 4) == [7, 14, 21, 28, 42]
output: def replace_elem(lst, new_elem, position):
      lst[position] = new_elem
      return lst