def mean(num_list):
    """
    This function calculates the mean of a list.

    Parameters
    ----------
    num_list : list
        The list of numbers that we want to get the mean of.
    
    Returns
    -------
    mean_list : float
        The mean of num_list.

    Examples
    --------
    >>> mean([1,2,3,4,5])
    3.0
    """

    if not isinstance(num_list, list):
        raise TypeError("Mean: {} is not a list".format(num_list))

    if len(num_list) == 0:
        raise ZeroDivisionError("Mean: the input list is length zero")

    mean_list = sum(num_list) / len(num_list)
    return mean_list