Advertisement
FelipeNeto2

Fibonacci em python

Jun 26th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.14 KB | None | 0 0
  1. a = 0
  2. b = 1
  3. c = 0
  4.  
  5. while(b<1000):
  6.   print(b)
  7.   b = b+a
  8.   a = b-a
  9.  
  10.   c = c+1
  11.  
  12.   if(b==0):
  13.     b = b+1
  14.  
  15. print('\n\n{} '.format(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement