'Why doesn't this function give me an answer? [duplicate]
This is the code that I am running. No problem is coming up, but it doesn't give me an answer either. I can't find the problem.
def fibonacci(n):
if n <= 0:
return False
elif n == 1 or n == 2:
return 1
else:
count = 1
n1, n2 = 1, 1
while count <= n:
n1 = n2
newn = n2+n1
if n == count:
return newn
else:
count += 1
fibonacci(3)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
