Archived
What is the output of this code?
def foo(n):
if n <= 1:
return n
else:
return foo(n-1) + foo(n-2)
print(foo(5))
-1
Community Evaluations
Similar QuestionsMore questions about Python
What is the output of this code?
def foo(n):
if n <= 1:
return n
else:
return foo(n-1) + foo(n-2)
print(foo(5))