input: Write a function to merge two sorted lists into a single sorted list. The function should take two parameters, `listA` and `listB`, which are the two sorted lists to be merged. If either list is empty, the function should return the non-empty list as it is.
  assert merge_sorted_lists([2, 4, 6], [3, 5, 7])==[2, 3, 4, 5, 6, 7]
  assert merge_sorted_lists([1, 3, 5], [2, 4, 6])==[1, 2, 3, 4, 5, 6]
  assert merge_sorted_lists([], [2, 4, 6])==[2, 4, 6]
  assert merge_sorted_lists([1, 3, 5], [])==[1, 3, 5]
  assert merge_sorted_lists([], [])==[]
output: def merge_sorted_lists(listA, listB):
      if not listA:
          return listB
      if not listB:
          return listA
      merged_list = []
      i, j = 0, 0
      while i < len(listA) and j < len(listB):
          if listA[i] < listB[j]:
              merged_list.append(listA[i])
              i += 1
          else:
              merged_list.append(listB[j])
              j += 1
      merged_list.extend(listA[i:])
      merged_list.extend(listB[j:])
      return merged_list