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 the median. The given array should be sorted before calculating the median. If the array has an odd number of elements, the median is the middle element; if it has an even number of elements, the median is the average of the two middle elements.
  assert mean_median([10, 15, 20, 25, 30, 35])==(22.5, 22.5)
  assert mean_median([1, 2, 3, 4, 5, 6])==(3.5, 3.5)
  assert mean_median([1, 9, 6, 4, 5])==(5, 5)
  assert mean_median([2, 3, 5, 7, 11, 13, 17, 19, 23])==(10, 11)
  assert mean_median([7])==(7, 7)
output: def mean_median(arr):
      arr.sort()
      n = len(arr)
      mean = sum(arr) / n
      if n % 2 == 1:
          median = arr[n // 2]
      else:
          median = (arr[n // 2 - 1] + arr[n // 2]) / 2
      return mean, median