Advertisement
juliarnasution

fibonacci

Aug 2nd, 2018
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. def fibonacci(n):
  2.     a,b = 0,1
  3.     while a<n:
  4.         print(a, end=' ')
  5.         a,b=b,a+b
  6.     print()
  7.    
  8. fibonacci(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement