Listing 08-07: Fibonacci recursive function

##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 08\08.07 - Fibonacci recursive function.py
# Description: Fibonacci recursive function
##############################################################################

def fibonacci(n):
    if n <= 1:
        return n
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)
Click here to download the file