  # Program for Fibonacci numbers

Hello,

In the article, we will see how to implement Fobonacci series in python. This is important article for technical interview preparation.

## What is Fibonacci series?

Definition:

a series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.

### How to calculate Fibonacci series

Given any number n , n is calculated as sum of n-1 and n-2

n = (n-1) + (n-2)

Fibonacci series start from 1

First 2 numbers are 1

For rest, above mentioned formula is used to calculate Fibonacci number.

### Python implementation to get Fibonacci series

``````def getfibonacci(count):
if(count<1):
return "Invalid data"

data= []
j=0
while(j<count):
if(j<2):
data.append(1)
else:
data.append(data[j-1]+data[j-2])
j+=1
return data

print(getfibonacci(100))
``````

## End note

In the article, you have seen how to generate Fibonacci sequence in Python.

If in case you have doubt regarding implementation, please feel free to share us your concerns in discussion thread below, or mail us to info@xamnation.com