input: Write a function to update the last element of a list with a new value.
  assert update_list([1, 2, 3], 5) == [1, 2, 5]
  assert update_list([4, 5, 6], 9) == [4, 5, 9]
  assert update_list([7, 8, 9], 0) == [7, 8, 0]
output: def update_list(lst, new_value):
      lst[-1] = new_value
      return lst