Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

AI-project

Function for nth Fibonacci number

def Fibonacci(n):

# Check if input is 0 then it will
# print incorrect input
if n < 0:
    print("Incorrect input")

# Check if n is 0
# then it will return 0
elif n == 0:
    return 0

# Check if n is 1,2
# it will return 1
elif n == 1 or n == 2:
    return 1

else:
    return Fibonacci(n-1) + Fibonacci(n-2)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors