input: def mean_median(arr):
      """
      Calculate the mean and median of a given array.
      The mean is the average of the array, and the median is the middle value 
      when the array is sorted. If the array has an even number of elements, 
      the median is the average of the two middle numbers.
  
      >>> mean_median([10, 15, 20, 25, 30, 35])
      (22.5, 22.5)
      """
output:     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)