code: def mean(data):
      
      if iter(data) is data:
          data = list(data)
      n = len(data)
      if n < 1:
          raise StatisticsError('mean requires at least one data point')
      return sum(data) / n
docs: Return the sample arithmetic mean of data.
  
      If ``data`` is empty, StatisticsError will be raised.