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

Default image
Aman Kharwal

I am a programmer from India, and I am here to guide you with Data Science, Machine Learning, Python, and C++ for free. I hope you will learn a lot in your journey towards Coding, Machine Learning and Artificial Intelligence with me.

Leave a Reply

Data Science | Machine Learning | Python | C++ | Coding | Programming | JavaScript