Skip to content

Instantly share code, notes, and snippets.

@vasily-kirichenko
Created August 28, 2011 08:34
Show Gist options
  • Select an option

  • Save vasily-kirichenko/1176428 to your computer and use it in GitHub Desktop.

Select an option

Save vasily-kirichenko/1176428 to your computer and use it in GitHub Desktop.
Python fibonacci
def fib(n):
if n == 0 or n == 1:
return n
else:
return fib(n-1) + fib(n-2)
for i in range(40):
print ("n=%d => %d" % (i, fib(i)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment