PEP style

This commit is contained in:
Akshay Sharma 2016-09-26 16:09:59 +05:30
parent a3c5167fad
commit 2dcb85d581

View File

@ -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)