Skip to content

Commit a4911c5

Browse files
Merge pull request ephremdeme#144 from matbiit/patch-1
Create fibonacci_recursive.py
2 parents 6534117 + 8e7ba4f commit a4911c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fibonacci/fibonacci_recursive.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def fibonacci(n):
2+
if n<=2:
3+
return 1
4+
else:
5+
return fibonacci(n-1) + fibonacci(n-2)
6+
7+
n = int(input('Enter a number (greather than 2): '))
8+
9+
for val in range(1,n-1):
10+
print(fibonacci(val), end = ', ')

0 commit comments

Comments
 (0)