- To print fibonacci series

User Input: 5

Output:

Fibonacci series : 0 1 1 2 3 5

```
num=int(input("Enter fibonacci series nth term : "))
print("Your fibonacci series :",end=" ")
a ,b = 0, 1
for i in range(0,num) :
print(a, end=" ")
a, b = b, a+b
```

Enter fibonacci series nth term : 8 Your fibonacci series : 0 1 1 2 3 5 8 13Program

number

You should know first :

**Fibonacci Series** : Series of numbers in which each number is the sum of the last 2 numbers

```
#Initially a & b :holds 1st & 2nd terms of fibonacci series
for i in range(0,num) :
print(a, end=" ")
a, b = b, a+b
```

Concept