input: Write a python function to get the first and last elements of a list.
  assert first_last([5, 3, 1, 7, 9]) == [5, 9]
  assert first_last([10, 20, 30, 40, 50]) == [10, 50]
  assert first_last(['a', 'b', 'c', 'd', 'e']) == ['a', 'e']
output: def first_last(lst):
      return [lst[0], lst[-1]]