Python Fibonacci Series with Example

Fibonacci Series Program in Python

In this program, we will learn to find the Fibonacci series program in python using the user-defined function. Before to start this you have to know about this:

for loop

if and else if statement

Fibonacci series is the sequence of 0, 1, 1, 2, 3, 5, 8,……

The first two values are 0 and 1. All other values are obtained by adding the preceding two terms. This means to say the nth term is the sum of (n-1)th and (n-2)th terms.

Fibonacci Series Source Code

def fibonacci_ser(num):



if num == 1:


elif num == 2 :

print(a, b)


print(a,b,end=" ")

for i in range(num-2):




print(b,end=" ")

num1=int(input("enter number to find Fabonacci series: "))

print(f'are fibibonacci of {num1}',fibonacci_ser(num1))


C:\Users\Pramod\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Pramod/PycharmProjects/pythonProject/
enter number to find Fabonacci series: 12
0 1 1 2 3 5 8 13 21 34 55 89 are fibibonacci of 12 None

Process finished with exit code 0
Fibonacci Series Program in Python

Recommended Post:

Get Salesforce Answers

Pramod Kumar Yadav is from Janakpur Dham, Nepal. He was born on December 23, 1994, and has one elder brother and two elder sisters. He completed his education at various schools and colleges in Nepal and completed a degree in Computer Science Engineering from MITS in Andhra Pradesh, India. Pramod has worked as the owner of RC Educational Foundation Pvt Ltd, a teacher, and an Educational Consultant, and is currently working as an Engineer and Digital Marketer.

Leave a Comment