code: def average(self, projection=None):
          
          length = self.size()
          if projection:
              return sum(self.map(projection)) / length
          else:
              return sum(self) / length
docs: Takes the average of elements in the sequence
  
          >>> seq([1, 2]).average()
          1.5
  
          >>> seq([('a', 1), ('b', 2)]).average(lambda x: x[1])
  
          :param projection: function to project on the sequence before taking the average
          :return: average of elements in the sequence