input: Write a function to merge two sorted lists into a single sorted list. The function should take two lists as input and return a new list that is the result of merging the two input lists. If either of the lists is empty, the function should return the non-empty list as is.
  assert merge_sorted_lists([2,4,6], [3,5,7])==[2,3,4,5,6,7]
  assert merge_sorted_lists([], [3,5,7])==[3,5,7]
  assert merge_sorted_lists([2,4,6], [])==[2,4,6]
  assert merge_sorted_lists([], [])==[]
output: def merge_sorted_lists(list1, list2):
      if not list1:
          return list2
      if not list2:
          return list1
      merged_list = []
      i, j = 0, 0
      while i < len(list1) and j < len(list2):
          if list1[i] < list2[j]:
              merged_list.append(list1[i])
              i += 1
          else:
              merged_list.append(list2[j])
              j += 1
      merged_list.extend(list1[i:])
      merged_list.extend(list2[j:])
      return merged_list