Created
September 29, 2018 07:41
-
-
Save ShaneRich5/f4be945b06d741162da6a185cf3b9d7a to your computer and use it in GitHub Desktop.
Fibonnaci Checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Fib_Checker(lst): | |
size = len(lst) | |
if size == 0: | |
return False | |
start = lst[0] | |
previous, current = 0, 1 | |
while current < start: | |
current, previous = previous + current, current | |
for i in range(size): | |
if current != lst[i]: | |
return False | |
current, previous = previous + current, current | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment