Fibonacci sequence

''' author: Luis Antonio Salazar date: 20/01/2015 ''' def fib(n): if n <= 1: return n else: return(fib(n-1) + fib(n-2)) nterms = int(input("Max number of term: ")) for i in range(nterms): print(fib(i))

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.