My code seems OK but i have 2/5 tests passed.

Lists start with an index of 0, but there’s no 0th Fibonnacci number for this excercise,

so if you’re using the **n**th index for the **n**th Fibonnaci number,

your initial list should have an extra element at index 0 to account for that;

like this

```
fib_list = [0, 0, 1]
```

The problem is easy to solve by using recursion:

[codebyte language=python]

def fib_finder(n):

# Write your code here

f = [0,1]

if n <= 0:

return “Invalid placement request”

elif n == 1:

return 0

elif n >= 1:

```
for i in range(1, n-1):
f.append(f[i-1] + f[i])
#print(f)
```

return f[len(f) - 1]

fib_finder(0)

print(fib_finder(2))[/codebyte]

here is my solution

```
def fib_finder(n):
fib = [0,1]
for x in range (1,n):
fib.append(fib[-1]+fib[-2])
return fib[n-1]
print(fib_finder(5))
```

Hi all,

Here is my solution. It works, but the limitation is if someone wants to find the 1,001th number in the sequence. Here it is:

```
# Write your code here:
fib_seq = [0,1]
def create_seq(num):
end = num - 1
for x in range(end):
third = fib_seq[x] + fib_seq[x+1]
fib_seq.append(third)
def fib_finder(number):
return(fib_seq[number-1])
create_seq(1000)
print(fib_finder(1))
print(fib_finder(2))
print(fib_finder(6))
```

Any critique is welcomed!

For some reason I did not trust myself at the beginning of this challenge, though it was so easy to accomplish in the end!

```
def fib_finder(n):
fib_sequence = [0, 0, 1]
for a in range(3, n+1):
fib_sequence.append(fib_sequence[a-2]+fib_sequence[a-1])
return fib_sequence[n]
```

Had to do some workarounds due to the zero-indexing system in python

In my opinion, the most intuitive way to do this.

Zero plus zero is not one. That initialization is not intuitive. Consider starting the sequence like so,

```
fib_sequence = [0, 1]
```

Sometimes we see the sequence start with 1, and not zero.

```
fib_sequence = [1, 1]
```

The the nth term of the sequence in the latter setup is offset from the former by -1.

Just for fits and giggles, let’s consider a version that only returns the nth term of either setup:

```
>>> def nth_fib(n, a=False):
... a, b, n, m = int(a), 1, n - a, int(not a)
... while n > m:
... b, a, n = a + b, b, n - 1
... return a
...
>>> nth_fib(5, True) # t(1) is 1
5 # 1, 1, 2, 3, 5
>>> nth_fib(5) # t(1) is 0
3 # 0, 1, 1, 2, 3
>>>
```

Maybe not exactly intuitive because it takes some sussing out of the logic.

It just keeps chugging away until a conclusion is met, and holds the most recent value as a return, with no need for a data structure that could take up a whack of memory just to obtain the last value appended. Why store any of the predecessor values? Well, we have the whole sequence, in print; but, on consideration, if we want to print we could do it with the above algorithm and still not use a data structure (though the OS might have a say in how this happens; anything to the display is a huge disruption); and, do it repeatedly.

Here’s mine using generators

Application of Dynamic Programming. Fill an array with zeros (n+1) times. Then set the third element to 1. Now the loop from 3 to the length of the array minus 1. Now return the last element of the array.

```
def fib_finder(n):
# Write your code here
if n<=1:
return 0
if n==2:
return 1
fibs = [0] * (n+1)
fibs[0] = 0
fibs[1] = 0
fibs[2] = 1
for i in range(3,len(fibs)):
fibs[i] = fibs[i-1] + fibs[i-2]
return fibs[n]
print(fib_finder(6))
```