Guest User

Untitled

a guest
Jun 25th, 2015
264
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mem = {0:0, 1:1}
  2.  
  3. def fib(n):
  4.     global mem
  5.     if n not in mem:
  6.         mem[n] = fib(n - 1)  + fib(n - 2)
  7.     return mem[n]
  8.    
  9. for i in range(100):
  10.     print(fib(i))
RAW Paste Data