Fibonacci numbers : Python

def fibonacci(n):
""" Returns a fibonacci number
Author: http://www.victorbyte.net """
if (n == 1) or (n==2):
return 1;
elif n >= 3:
return fibonacci(n - 1)+fibonacci(n-2);
This entry was posted in introduction, programming. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *