MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / fibonacci

Function fibonacci

example_code/item_038.py:66–70  ·  view source on GitHub ↗

Return the n-th Fibonacci number

(n)

Source from the content-addressed store, hash-verified

64print("Example 2")
65@trace
66def fibonacci(n):
67 """Return the n-th Fibonacci number"""
68 if n in (0, 1):
69 return n
70 return fibonacci(n - 2) + fibonacci(n - 1)
71
72
73print("Example 3")

Callers 1

item_038.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected