def mean(num_list):
    """
    Computes the mean of a list of numbers

    Parameters
    ----------
    num_list : list
        List of number to calculate mean of

    Returns
    -------
    mean : float
        Mean value of the num_list
    """

    # Check that input is of type list

    if not isinstance(num_list, list):

        raise TypeError('Invalid input %s - must be type list' % (num_list))

    list_sum = 0.0

    list_len = len(num_list)

    # Check that the list is not empty
    if list_len == 0:
        raise ValueError("Num list is empty")

    for el in num_list:
        list_sum += el

    return list_sum / list_len