Skip to content

Commit ad094fd

Browse files
author
Huu Nguyen
committed
Rearrange base case
1 parent 5a2e5a2 commit ad094fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Numbers/fibonacci.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ def fib(N):
77
sequence.
88
99
"""
10-
if N > 1:
10+
if N == 1:
11+
return [1, 0]
12+
else:
1113
terms = fib(N - 1)
1214
terms = [terms[0] + terms[1], terms[0]]
1315
return terms
14-
else:
15-
return [1, 0]
1616

1717

1818
def validate_positive_integer():

0 commit comments

Comments
 (0)