Defining functions in python def fib(n): """Return a list of fibonacci numbers smaller than N""" a, b = 0, 1 result = [] while b < n: result.append(b) a, b = b, a+b return result >>> fib(10) [1, 1, 2, 3, 5, 8] functions can have default arguments functions can have variable number of arguments functions can return complex data structures