Skip to content

Commit ba20518

Browse files
authored
Create fastfibonacci
1 parent 0868c25 commit ba20518

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Python/fastfibonacci

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(Fibonacci(2))

0 commit comments

Comments
 (0)