input: def find_median(arr: list):
      """Calculate and return the median value of the numbers in the list arr.
      >>> find_median([3, 1, 2, 4, 5])
      3
      >>> find_median([-10, 4, 6, 1000, 10, 20])
      15.0
      """
output:     arr.sort()
      n = len(arr)
      mid = n // 2
      
      if n % 2 == 0:
          return (arr[mid - 1] + arr[mid]) / 2.0
      else:
          return arr[mid]