code: def for_each(self, operation, limit=0, verbose=False):
          
          if limit != 0:
              count = 0
              while self.has_next():
                  operation.perform(self.next())
                  count += 1
                  if verbose:
                      print count
                  if count >= limit:
                      break
          else:
              while self.has_next():
                  operation.perform(self.next())
docs: Applies the given Operation to each item in the stream. The Operation executes on the
          items in the stream in the order that they appear in the stream.
  
          If the limit is supplied, then processing of the stream will stop after that many items
          have been processed.