Return a generator of n-gram from an iterable

def ngram(n, iter_tokens):
    """
    Return a generator of n-gram from an iterable
    """
    z = len(iter_tokens)
    return (iter_tokens[i:i+n] for i in range(z-n+1))