input: Write a python function to calculate the sum of the first n elements in a list.
  assert sum_of_elements([1, 2, 3, 4, 5], 3) == 6
  assert sum_of_elements([10, 20, 30, 40, 50], 5) == 150
  assert sum_of_elements([5, 15, 25], 2) == 20
output: def sum_of_elements(lst, n):
      return sum(lst[:n])