code: def compute(slidingWindow, total, newVal, windowSize):
      
      if len(slidingWindow) == windowSize:
        total -= slidingWindow.pop(0)
  
      slidingWindow.append(newVal)
      total += newVal
      return float(total) / len(slidingWindow), slidingWindow, total
docs: Routine for computing a moving average.
  
      @param slidingWindow a list of previous values to use in computation that
          will be modified and returned
      @param total the sum of the values in slidingWindow to be used in the
          calculation of the moving average
      @param newVal a new number compute the new windowed average
      @param windowSize how many values to use in the moving window
  
      @returns an updated windowed average, the modified input slidingWindow list,
          and the new total sum of the sliding window