Advertisement
QuantumWarpCode

Fibonacci Python

Jul 3rd, 2015
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.10 KB | None | 0 0
  1. def fibonacci(self, n):
  2.     a = 0
  3.     b = 1
  4.     for i in range (1, n):
  5.         c = a + b
  6.         a = b
  7.         b = c
  8.     return a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement