input: Write a python function to perform merge sort on a list of integers.
  assert merge_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5])==[1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]
  assert merge_sort([10, 9, 8, 7, 6, 5, 4, 3, 2, 1])==[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  assert merge_sort([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])==[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
output: def merge_sort(arr):
      if len(arr) <= 1:
          return arr
  
      mid = len(arr) // 2
      left_half = merge_sort(arr[:mid])
      right_half = merge_sort(arr[mid:])
  
      return merge(left_half, right_half)
  
  def merge(left, right):
      sorted_list = []
      left_index = right_index = 0
  
      while left_index < len(left) and right_index < len(right):
          if left[left_index] < right[right_index]:
              sorted_list.append(left[left_index])
              left_index += 1
          else:
              sorted_list.append(right[right_index])
              right_index += 1
  
      sorted_list.extend(left[left_index:])
      sorted_list.extend(right[right_index:])
  
      return sorted_list