Skip to content
CodeItRaw
Code Reading
/
Calling Itself
Path
Play
Daily
Leaderboard
tr
Predict the Output
Calling Itself
f(0) and f(1) return 1; everything else adds two smaller calls. What is printed?
1
def
f
(n):
2
if
n <=
1
:
3
return
1
4
return
f(n -
1
) + f(n -
2
)
5
6
print
(f(
6
))