[Chicago] Python Tutorial 4.6 function fib()

Kenneth P. Stox ken at stox.org
Sun Jan 6 09:33:43 CET 2008


Welcome to the wonderful world of recursion:

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




More information about the Chicago mailing list