def mean(mylist):
    """
    function to take the mean of a list
    
    Parameters
    ----------
    mylist : list
        list of numbers to take a mean
    
    
    Returns
    -------
    mean_list : float
        The mean of the list.


    Examples
    --------
    >>> mean([1,2,3,4,5,6,7])
    4.0


    """
    if not isinstance(mylist, list):
        raise TypeError("Mean: %s is not a list!" % mylist)

    return (sum(mylist) / len(mylist))