In this article, you will learn to make a Fibonacci series program in python.
A Fibonacci sequences is sequences of 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, .....
The first two terms are 0 and 1. All other terms are obtained by adding the preceding two terms.
Fn = F(n-1) +F(n-2)
- First, we have to take input of n terms from the users.
- We have to set the first number 0 and the second number 1.
- Now, we have to check whether the n terms are greater than o or not.
- And then, we do the sum of the first and second terms and also print the first term.
- Then we set the second term to first and sum to the second term.