Advertisement
rfmonk

fibonacci1.py

Dec 16th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # credit goes to antiloquax for all the fib scripts
  3. # using a list
  4.  
  5. print("Fibonacci")
  6. fib = [0, 1]
  7.  
  8. for i in range(10):
  9.     fib.append(fib[i] + fib[i+1])
  10.  
  11. print(fib)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement