If you are a programming beginner or know a little bit about mathematics, you have probably heard of the Fibonacci sequence at some point. According to Wikipedia, the Fibonacci sequence is a sequence in which each number is equal to the sum of the previous two numbers.

In this blog, I will go through 2 ways you can generate this sequence using Python 3.

Method 1: Recursion

In programming languages, recursion occurs whenever a function calls itself once or several times to compute an algorithm. You can read more about recursion here.

These are the steps to create this recursive function:

An incomplete sudoku.
An incomplete sudoku.
This is how a typical sudoku looks like.

According to Wikipedia, Sudoku is a logic-based, combinatorial number-placement puzzle. In classic sudoku, the objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid (also called “boxes”, “blocks”, or “regions”) contain all of the digits from 1 to 9.

These are the rules of the regular sudoku:

Knowing what a…

Kevin Andrey Romero Oviedo

I am a programmer, casual gamer, full-time geek, and math enthusiast.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store