fibonnaci module

class fibonnaci.Fibonacci[source]

Bases: object

A class that provides methods to calculate Fibonacci numbers.

iterative(n)[source]

Calculates the nth Fibonacci number using an iterative approach.

Parameters: - n (int): The index of the Fibonacci number to calculate.

Returns: - int: The nth Fibonacci number.

memoization(n)[source]

Calculates the nth Fibonacci number using memoization.

Parameters: - n (int): The index of the Fibonacci number to calculate.

Returns: - int: The nth Fibonacci number.

recursive(n)[source]

Calculates the nth Fibonacci number using a recursive approach.

Parameters: - n (int): The index of the Fibonacci number to calculate.

Returns: - int: The nth Fibonacci number.