Skip to content

Instantly share code, notes, and snippets.

@vikychoi
Created January 30, 2018 09:11
Show Gist options
  • Save vikychoi/9aba84d37042b126d2765cfa18e2e459 to your computer and use it in GitHub Desktop.
Save vikychoi/9aba84d37042b126d2765cfa18e2e459 to your computer and use it in GitHub Desktop.
Returns value of requested term of Fibonacci number
def fibonnaci(x):
if(x == 1):
return 1
elif(x == 0):
return 0
else:
return fibonnaci(x -1) + fibonnaci(x -2)
number = int(input("Please entre the number of term of fibonnaci number"))
print("The number of ", number,"term of fibonnaci number is ", fibonnaci(number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment