fr
fr

Question from the Python - Fundamentals test

What is the output of the following code?

Hard

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))
Author: Pierre ChaumontStatus: Published(Update)(Update proposal available)Question passed 38 times
Edit
0
Community Evaluations
developer avatar
Other
Marion
16/01/2025
Pas assez de temps pour répondre à la question