Taking the first few items of a list until a target sum is exceeded
So, a couple things:


The problem statement says nothing about printing data, so you can omit the print statement, and thus the entire else: clause, entirely.
The problem statement says to return a list, and you're just returning the last item in that list, not the entire list.


Here's a short but inefficient way to do it:

def numberlist(nums, limit):
    i = 0
    while sum(nums[:i]) &lt; limit:
        i += 1
    return nums[:i]


or a more efficient but longer way:

def numberlist(nums, limit):
    prefix = []
    sum = 0
    for num in nums:
        sum += num
        prefix.append(num)
        if sum &gt; limit:
            return prefix