code: def popwhile(predicate, iterable):
      
      while iterable:
          item = iterable.pop()
          if predicate(item):
              yield item
          else:
              break
docs: Generator function yielding items of iterable while predicate holds for each item
  
      :param predicate: function taking an item returning bool
      :param iterable: iterable
      :returns: iterable (generator function)