MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / __init__

Method __init__

dynamic_programming/fibonacci.py:9–18  ·  view source on GitHub ↗
(self, N=None)

Source from the content-addressed store, hash-verified

7class Fibonacci:
8
9 def __init__(self, N=None):
10 self.fib_array = []
11 if N:
12 N = int(N)
13 self.fib_array.append(0)
14 self.fib_array.append(1)
15 for i in range(2, N + 1):
16 self.fib_array.append(self.fib_array[i - 1] + self.fib_array[i - 2])
17 elif N == 0:
18 self.fib_array.append(0)
19
20 def get(self, sequence_no=None):
21 if sequence_no != None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected