input: Write a function to read an array from the user and then determine the mean and median of the 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 (0, 0).
  
  def mean_median(arr):
      if not arr:
          return (0, 0)
      
      arr_sum = 0
      for num in arr:
          arr_sum += num
      
      mean = arr_sum / len(arr)
      
      sorted_arr = sorted(arr)
      if len(sorted_arr) % 2 != 0:
          median = sorted_arr[len(sorted_arr) // 2]
      else:
          median = (sorted_arr[len(sorted_arr) // 2] + sorted_arr[len(sorted_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([]) == (0, 0)
  assert mean_median([1]) == (1.0, 1)
  assert mean_median([1, 2]) == (1.5, 1.5)
output: def mean_median(arr):
      if not arr:
          return (0, 0)
      
      arr_sum = 0
      for num in arr:
          arr_sum += num
      
      mean = arr_sum / len(arr)
      
      sorted_arr = sorted(arr)
      if len(sorted_arr) % 2 != 0:
          median = sorted_arr[len(sorted_arr) // 2]
      else:
          median = (sorted_arr[len(sorted_arr) // 2] + sorted_arr[len(sorted_arr) // 2 - 1]) / 2
      
      return mean, median