import itertools


def prettylist(name, mylist, N=10, prefix='\t'):
    """Return formatted str: first N items of list or generator, prefix & name"""
    try:
        return('{}{}: {}...'.format(prefix, name, mylist[:N]))
    except TypeError:
        ans = itertools.islice(mylist, N)
        return('{}{}: {}...'.format(prefix, name, ans))