Fixed bug in getAllFib function

This commit is contained in:
Matthew Ellison
2019-02-09 12:54:32 -05:00
parent 2e149da67a
commit 674b62b671

View File

@@ -181,7 +181,7 @@ def getAllFib(goalNumber: int) -> list:
#Loop to generate the rest of the Fibonacci numbers
while(fibNums[len(fibNums) - 1] <= goalNumber):
fibNums.append(fibNums[len(fibNums) - 2] + fibNums[len(fibNums) - 3])
fibNums.append(fibNums[len(fibNums) - 1] + fibNums[len(fibNums) - 2])
#At this point the most recent number is > goalNumber, so remove it
fibNums.pop()