9 Program to print Fibonacci Series using Python

Program:

num = int(input("Enter any number:"))
f0 = 0
f1 = 1
f2 = 1

for i in range(num):

    print(f0,end="  ")

    f0 = f1

    f1 = f2

    f2 = f1 + f0

Output:
Previous
Next Post »