fib(1) = 1
fib(2) = 1
fib(n) = fib(n-1) + fib(n-2)
examples/functions/fibonacci.py
from __future__ import print_function

def fib(n):
    if n == 1:
        return 1
    if n == 2:
        return 1
    return fib(n-1) + fib(n-2)

print(3, fib(3))    # 2
print(30, fib(30))  # 832040

Python also supports recursive functions.