mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-31 06:33:44 +00:00
PEP style
This commit is contained in:
parent
a3c5167fad
commit
2dcb85d581
|
@ -4,6 +4,7 @@ This is a pure Python implementation of Dynamic Programming solution to the fibo
|
||||||
|
|
||||||
|
|
||||||
class Fibonacci:
|
class Fibonacci:
|
||||||
|
|
||||||
def __init__(self, N=None):
|
def __init__(self, N=None):
|
||||||
if N:
|
if N:
|
||||||
N = int(N)
|
N = int(N)
|
||||||
|
@ -12,7 +13,7 @@ class Fibonacci:
|
||||||
self.fib_array[1] = 1
|
self.fib_array[1] = 1
|
||||||
for i in range(2, N + 1):
|
for i in range(2, N + 1):
|
||||||
self.fib_array[i] = self.fib_array[
|
self.fib_array[i] = self.fib_array[
|
||||||
i - 1] + self.fib_array[i - 2]
|
i - 1] + self.fib_array[i - 2]
|
||||||
else:
|
else:
|
||||||
self.fib_array = [None] * (N + 1)
|
self.fib_array = [None] * (N + 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user