input: Write a function to replace the last element of a list with elements from another list.
  assert replace_last_element([1, 2, 3], [4, 5]) == [1, 2, 4, 5]
  assert replace_last_element([10, 20, 30], [40]) == [10, 20, 40]
  assert replace_last_element(['a', 'b', 'c'], ['x', 'y', 'z']) == ['a', 'b', 'x', 'y', 'z']
output: def replace_last_element(list1, list2):
      return list1[:-1] + list2