Skip to content

Commit bb7e4ba

Browse files
Merge pull request #588 from gbasupi/master
fastfibonacci
2 parents 55c522b + 62fc79d commit bb7e4ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Python/fastfibonacci.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def fastfibonacci(i):
2+
if i<0:
3+
print("Incorrect input, enter number >= 0")
4+
elif i==0:
5+
return 0
6+
elif i==1:
7+
return 1
8+
else:
9+
return fastfibonacci(i-1)+fastfibonacci(i-2)
10+
11+
print(fastfibonacci(2))

0 commit comments

Comments
 (0)