input: Write a class named MedianFinder that can find the median of an unsorted list of numbers. The class should have an 'add' method to add numbers to the list and a 'find_median' method to calculate and return the median of the list.
  
  assert MedianFinder().add(1).add(2).add(3).find_median()==2.0
  assert MedianFinder().add(1).add(2).add(3).add(4).find_median()==2.5
  assert MedianFinder().add(7).add(3).add(5).find_median()==5.0
  assert MedianFinder().add(10).add(20).add(30).add(40).find_median()==25.0
  assert MedianFinder().add(15).add(25).add(5).add(35).find_median()==20.0
output: class MedianFinder:
      def __init__(self):
          self.nums = []
  
      def add(self, num):
          self.nums.append(num)
          return self
  
      def find_median(self):
          self.nums.sort()
          n = len(self.nums)
          if n % 2 == 0:
              return (self.nums[n//2 - 1] + self.nums[n//2]) / 2
          else:
              return self.nums[n//2]