Skip to content

Commit

Permalink
fibb.py
Browse files Browse the repository at this point in the history
  • Loading branch information
b19149 authored Oct 24, 2020
1 parent d62e618 commit 48c951b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Python/fibb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Function for nth Fibonacci number

def Fibonacci(n):
if n<=0:
print("Incorrect input")
# First Fibonacci number is 0
elif n==1:
return 0
# Second Fibonacci number is 1
elif n==2:
return 1
else:
return Fibonacci(n-1)+Fibonacci(n-2)

# Driver Program

print(Fibonacci(9))

#This code is contributed by Saket Modi

0 comments on commit 48c951b

Please sign in to comment.