input: Write a function to determine the mean and median of a given array. The function should read an array of numbers and return the mean and median values.
  assert mean_median([10, 15, 20, 25, 30, 35])==(22.5, 22.5)
  assert mean_median([3, 5, 7, 12, 13, 14, 21, 23, 23, 23, 23, 29, 40, 56])==(22.884615384615383, 23)
  assert mean_median([1, 2, 3, 4, 5])==(3.0, 3)
  assert mean_median([2, 4, 6, 8, 10, 12])==(7.0, 7)
  assert mean_median([])==(None, None)
output: def mean_median(arr):
      if not arr:
          return None, None
      arr.sort()
      n = len(arr)
      mean = sum(arr) / n
      if n % 2 == 0:
          median = (arr[n//2 - 1] + arr[n//2]) / 2
      else:
          median = arr[n//2]
      return mean, median