input: Write a function to read an array from the user and then determine the mean and median of the array. The function should return both the mean and median. If the array is empty, it should return None for both values.
  assert mean_median([10, 15, 20, 25, 30, 35])==(22.5, 22.5)
  assert mean_median([23, 15, 22, 16, 12])==(17.6, 16)
  assert mean_median([])==(None, None)
output: def mean_median(arr):
      if not arr:
          return None, None
      arr.sort()
      mean = sum(arr) / len(arr)
      n = len(arr)
      if n % 2 == 0:
          median = (arr[n//2 - 1] + arr[n//2]) / 2
      else:
          median = arr[n//2]
      return mean, median