code: def pairwise_longest(iterable, fillvalue=None):
      "s -> (s0,s1), (s1,s2), (s2, s3), ..."
      a, b = tee(iterable)
      next(b, None)
      return zip_longest(a, b, fillvalue=fillvaluef pairwise_longest(iterable, fillvalue=None):
      "s -> (s0,s1), (s1,s2), (s2, s3), ..."
      a, b = tee(iterable)
      next(b, None)
      return zip_longest(a, b, fillvalue=fillvalue)
docs: s -> (s0,s1), (s1,s2), (s2, s3), ...