Fill the operator to add n to the recursive result.
def rec(n):
if n == 0: return 0
return n ____ rec(n - 1)
Answer: +
It sums n with the sum of everything below → 1+2+…+n.
Play Problem Solving ▸
def rec(n):
if n == 0: return 0
return n ____ rec(n - 1)
Answer: +