Advertisement
naeem043

Python Fibonacci Serise

Oct 10th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. n = int(input('Enter the number: '))
  2. n1 = 0
  3. n2 = 1
  4. count = 0
  5. print("The "+str(n)+"th fibonacci serise:")
  6. while count < n:
  7.     print(n1,end=' , ')
  8.     nth = n1 + n2
  9.     n1 = n2
  10.     n2 = nth
  11.     count += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement