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