Skip to content

Instantly share code, notes, and snippets.

@glpunk
Created November 19, 2014 00:41
Show Gist options
  • Save glpunk/bed9c9bd333d1ca83deb to your computer and use it in GitHub Desktop.
Save glpunk/bed9c9bd333d1ca83deb to your computer and use it in GitHub Desktop.
python fibonacci example
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