Home
Press ? for keyboard navigation
❮
Decorator to register function
trace fibo
❯
A recursive Fibonacci
examples/decorators/fibo.py
def
fibo
(
n
):
if
n
in
(
1
,
2
):
return
1
return
fibo
(
n
-
1
)
+
fibo
(
n
-
2
)
print
(
fibo
(
5
))
# 5
Index (i)
Table of Contents (t)
Indexed keywords (k)
Chapter TOC (d)
Hide/Show (h)