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!

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay