Well done!

You have completed Recap: Algorithms in Code!

Quiz Question 1 of 3

Given the following functions, which of the two is a recursive function?

def sum(list):
    sum = 0
    for i in range(0, len(list)):
        sum += list[i]
    return sum
def sum_values(list):
    if len(list) == 1:
        return list[0]
    else:
        return list[0] + sum_values(list[1:])

Choose the correct answer below:

Skip Quiz Review Video