def first(iterable, *args):
    """
    Return the first item from the iterable.

    >>> first(range(11))
    0
    >>> first([3,2,1])
    3
    >>> iter = range(11)
    >>> first(iter)
    0

    Raises StopIteration if no value is present.

    >>> first([])
    Traceback (most recent call last):
    ...
    StopIteration

    Pass a default to be used when iterable is empty.

    >>> first([], None)

    """
    iterable = iter(iterable)
    return next(iterable, *args)
