input: Write a function to determine the mean and median of a given array. The function should return both values. If the array is empty, it should return (None, None).
  
  assert mean_median([10, 15, 20, 25, 30, 35])==(22.5, 22.5)
  assert mean_median([5, 10, 15, 20, 25, 30])==(17.5, 17.5)
  assert mean_median([1, 2, 3, 4, 5])==(3.0, 3)
  assert mean_median([1])==(1.0, 1)
  assert mean_median([])==(None, None)
output: def mean_median(arr):
      if not arr:
          return None, None
      arr.sort()
      mean_val = sum(arr) / len(arr)
      mid = len(arr) // 2
      if len(arr) % 2 == 0:
          median_val = (arr[mid - 1] + arr[mid]) / 2
      else:
          median_val = arr[mid]
      return mean_val, median_val