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 the mean and median as a tuple. If the array is empty, the function should return (None, None). Use the following template for the function and test cases:
  
  def mean_median(arr):
      if len(arr) == 0:
          return None, None
      
      arr_sum = sum(arr)
      mean = arr_sum / len(arr)
      
      sorted_arr = sorted(arr)
      if len(arr) % 2 != 0:
          median = sorted_arr[len(arr) // 2]
      else:
          median = (sorted_arr[len(arr) // 2] + sorted_arr[len(arr) // 2 - 1]) / 2
      
      return mean, median
  
  assert mean_median([10, 15, 20, 25, 30, 35]) == (22.5, 22.5)
  assert mean_median([3, 5, 10, 1, 2]) == (4.2, 3)
  assert mean_median([4, 3, 1, 2]) == (2.5, 2.5)
  assert mean_median([3, 5, 4, 1, 2]) == (3.0, 3)
  assert mean_median([]) == (None, None)
output: def mean_median(arr):
      if len(arr) == 0:
          return None, None
      
      arr_sum = sum(arr)
      mean = arr_sum / len(arr)
      
      sorted_arr = sorted(arr)
      if len(arr) % 2 != 0:
          median = sorted_arr[len(arr) // 2]
      else:
          median = (sorted_arr[len(arr) // 2] + sorted_arr[len(arr) // 2 - 1]) / 2
      
      return mean, median