input: Write a class in Python that can find the median of an unsorted list of numbers. If the list is empty, the method should return None.
  
  class MedianFinder:
   def __init__(self):
       self._data = []
   
   def add(self, num):
       self._data.append(num)
   
   def find_median(self):
       if not self._data:
           return None
       data = sorted(self._data)
       n = len(data)
       return (data[(n-1)//2] + data[n//2])/2
  
  assert MedianFinder().find_median()==None
  assert MedianFinder().add(5).find_median()==5
  assert MedianFinder().add(1).add(3).add(2).find_median()==2
  assert MedianFinder().add(1).add(3).add(2).add(4).find_median()==2.5
  assert MedianFinder().add(10).add(20).add(30).add(40).find_median()==25
output: 
  class MedianFinder:
      def __init__(self):
          self._data = []
   
      def add(self, num):
          self._data.append(num)
          return self
   
      def find_median(self):
          if not self._data:
              return None
          data = sorted(self._data)
          n = len(data)
          return (data[(n-1)//2] + data[n//2])/2
  