Categories
By Aman Kharwal

Fibonacci Series with python

The most simplest program to print Fibonacci series with python

lastNumber = int(input("Enter last number of series: "))
firstNumber, secondNumber = 0, 1
for i in range(0, lastNumber):
    print(firstNumber)
    firstNumber, secondNumber = secondNumber, firstNumber + secondNumber
#Output
Enter last number of series: 10
0
1
1
2
3
5
8
13
21
34

Leave a Reply