code: def interleave(inter, f, seq):
      
      seq = iter(seq)
      try:
          f(next(seq))
      except StopIteration:
          pass
      else:
          for x in seq:
              inter()
              f(x)
docs: Call f on each item in seq, calling inter() in between.