DEV Community

Alex Pushkarev
Alex Pushkarev

Posted on

1 1

Tutorial: Nth Fibonacci number in Python

In this short video tutorial we will create a recursive algorithm for calculating Nth number of the Fibonacci series.

❓ What is The Fibonacci sequence?
👉🏻The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers. The first two numbers in the Fibonacci sequence are 0 and 1, and the sequence goes on from there.

❓ How to calculate Nth number of Fibonacci sequence in Python?
👉🏻Calculating a value of an Nth number of the Fibonacci sequence is one of the fundamental recursive problems. In this video I will show step-by-step tutorial for writing a solution for this problem in Python using test-driven development.

This is one of the most simple way to implement Nth Fibonacci number algorithm in Python and it isn't the most effective one.

Can you guess what would be time complexity for it? Feel free to write your gueeses in comments!

AWS Security LIVE! Stream

Go beyond the firewall

There's more to security than code. Explore solutions, strategies, and the full story on AWS Security LIVE!

Learn More

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Dive into this informative piece, backed by our vibrant DEV Community

Whether you’re a novice or a pro, your perspective enriches our collective insight.

A simple “thank you” can lift someone’s spirits—share your gratitude in the comments!

On DEV, the power of shared knowledge paves a smoother path and tightens our community ties. Found value here? A quick thanks to the author makes a big impact.

Okay