For appreciating this post, I request you to go through 5 Ways of Fibonacci in Python post of mine, where I have explained 5 different ways by which you could write code for finding nth Fibonacci number. At the end of the post, I had promised you that I would come up with performance measurements for each … Continue reading 5 Ways of Fibonacci in Python – Best way!
Tag: Fibonacci
5 Ways of Fibonacci in Python
After learning so much about development in Python, I thought this article would be interesting for readers and to myself... This is about 5 different ways of calculating Fibonacci numbers in Python [sourcecode language="python"] ## Example 1: Using looping technique def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a print … Continue reading 5 Ways of Fibonacci in Python