Advertisement
rfmonk

fibonacci.py

Dec 16th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # credit goes to antiloquax for all the fib scripts
  3. # fib.py - calculates the fibonacci series
  4.  
  5. a = 0
  6. b = 1
  7. print("Fibonacci")
  8. print(a, b, end="")
  9.  
  10. for i in range(10):
  11.     c = b + a
  12.     print(c, end= "")
  13.     a, b = b, c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement