input: Write a function to compute the mean and median of a given array. The function should take an array as input and return a tuple containing the mean and median. If the array is empty, the function should return None for both mean and median.
  def mean_median(arr): 
        if len(arr) == 0: 
              return None, None 
        
        arr_sum = 0 
        for i in range(len(arr)): 
              arr_sum += arr[i] 
        
        mean = arr_sum/len(arr) 
      
        arr = sorted(arr) 
        if len(arr) % 2 != 0: 
              median = arr[len(arr)//2] 
        else: 
              median = (arr[len(arr)//2] + 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([5, 10, 15, 20, 25])==(15.0, 15)
  assert mean_median([1, 2, 3, 4, 5, 6])==(3.5, 3.5)
  assert mean_median([])==(None, None)
output: def mean_median(arr): 
        if len(arr) == 0: 
              return None, None 
        
        arr_sum = 0 
        for i in range(len(arr)): 
              arr_sum += arr[i] 
        
        mean = arr_sum/len(arr) 
      
        arr = sorted(arr) 
        if len(arr) % 2 != 0: 
              median = arr[len(arr)//2] 
        else: 
              median = (arr[len(arr)//2] + arr[len(arr)//2 - 1]) / 2
        
        return mean, median