Created
November 19, 2014 00:41
-
-
Save glpunk/bed9c9bd333d1ca83deb to your computer and use it in GitHub Desktop.
python fibonacci example
This file contains 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 genFibo(arr): | |
arr.append( arr[-1]+arr[-2] ) | |
def isFibo(n, fibos): | |
if n in fibos: | |
foo = 'IsFibo' | |
else: | |
foo = 'IsNotFibo' | |
return foo | |
fibos = [0,1] | |
for i in range(0,10): | |
genFibo(fibos) | |
t = int(input()) | |
for i in range(0,t): | |
foo = int(input()) | |
print( isFibo(foo, fibos) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment