> else: > f(i+1,sm+a[i]) Maybe because you are ignoring the return value of the when you recurse... try this else: return f(i+1, sm+a[i]) -Dave