def sum_rec(nums):
    """
    Returns the sum of a list of numbers using recursion

    Examples:
        >>> sum_rec([3,1,4,1,5,9,2,6,5])
        36
        >>> sum_rec(range(101))
        5050
        >>> sum_rec(range(901))
        405450
        >>> sum_rec([x**3 - 2*x**2  + x - 13 for x in range(901)])
        163903285937
        >>> sum_rec([-1 for x in range(900)])
        -900
    """
    if nums == []:
        return 0
    else:
        return sum_rec(list(nums[1:])) + nums[0]