def fib(n):
if n < 0:
return
if n < 1:
return 0
memo = {}
for i in range(1, n + 1):
if i <= 2:
memo[i] = 1
else:
memo[i] = memo[i-1] + memo[i-2]
return memo[n]
for i in range(10):
print(fib(i))
To embed this project on your website, copy the following code and paste it into your website's HTML: