Hey If you are beginner and want to learn a python then you are on right path. Learn basic as well as advanced programming in Python.

Search

Fibonacci series in Python.

PYHTON PROGRAM



"""

Python program to generate Fibonacci series.

"""

n=int(input("Enter number of terms:"))

f=0

s=1

next=0

count=1

print("Fibonacci Series:")

while(count<=n):

  print(next, end= " ")

  count=count+1

  f=s

  s=next

  next=f+s



*** Input && Output ***





No comments:

Post a Comment

let me know which type examples you want to comment me.