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)

for val in range(1, 9):
    print(val, fib(val))

# 1 1
# 2 1
# 3 2
# 4 3
# 5 5
# 6 8
# 7 13
# 8 21

Python also supports recursive functions.