def sum_until_negative(a_list):
    """
    @purpose Summing items in a list, stops as soon as a negative number is reached.
            If first item is negative, or list is empty, returns 0
    @parameter
        a_list: A list passed to be summed until negative number reached
    @Complexity:    Worst Case - O(N): goes through the whole list when none is negative
                    Best Case - O(1): empty list or first is negative
    @pre-condition An integer list is passed
    @post-condition Returns the sum of numbers up until negative number reached
    """
    try:
        sum = 0
        if len(a_list) > 0:
            for i in range(len(a_list)):
                if a_list[i] >= 0:
                    sum += a_list[i]
                else:   # if encountered a negative number, stop
                    return sum
            return sum
        else:
            return sum
    except TypeError:
        return "Please only insert numerical type lists."