Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Curso explicación fib.
def fib(n):
if n < 2:
return n
return fib(n-1) + fib(n-2)
def fib_seq(n):
Calcula la secuencia de fibonacci hasta n
>>> fib_seq(10)
[1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
res = []
for i in range(1, n+1):
return res
n = 10
res = fib_seq(n)
print('La secuencia Fibbonaci hasta %s es: %s' % (n, res))
print([fib(i)**3 for i in range(1, n+1)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.