def intersperse(x, ys):
    """
    Returns an iterable where ``x`` is inserted between
    each element of ``ys``

    :type ys: Iterable
    """
    it = iter(ys)
    try:
        y = next(it)
    except StopIteration:
        return
    yield y
    for y in it:
        yield x
        yield y
